galera sempre li e ouvi que dois métodos tem a mesma assinatura se forem iguais:
nome Metodo;
tipo de parametro;
quantidade de parametro;
ordem dos parametros;
bem eu estava lendo a especificação notei que ele fala que assinaturas iguais são apenas nome e numero de parâmetro iguais. Talvez seja a minha interpretação que esteja errada.
Segue o texto:
[b]
It is a compile-time error to declare two methods with override-equivalent signatures (defined below) in a class.
Two methods have the same signature if they have the same name and argument types.
Two method or constructor declarations M and N have the same argument types if all of the following conditions hold:
* They have the same number of formal parameters (possibly zero)
* They have the same number of type parameters (possibly zero)
* Let <A1,...,An> be the formal type parameters of M and let <B1,...,Bn> be the formal type parameters of N. After renaming each occurrence of a Bi in N's type to Ai the bounds of corresponding type variables and the argument types of M and N are the same.
The signature of a method m1 is a subsignature of the signature of a method m2 if either
* m2 has the same signature as m1, or
* the signature of m1 is the same as the erasure of the signature of m2.
Discussion
The notion of subsignature defined here is designed to express a relationship between two methods whose signatures are not identical, but in which one may override the other.
Specifically, it allows a method whose signature does not use generic types to override any generified version of that method. This is important so that library designers may freely generify methods independently of clients that define subclasses or subinterfaces of the library.
Consider the example:
class CollectionConverter {
List toList(Collection c) {...}
}
class Overrider extends CollectionConverter{
List toList(Collection c) {...}
}
Now, assume this code was written before the introduction of genericity, and now the author of class CollectionConverter decides to generify the code, thus:
class CollectionConverter {
<T> List<T> toList(Collection<T> c) {...}
}
Without special dispensation, Overrider.toList() would no longer override CollectionConverter.toList(). Instead, the code would be illegal. This would significantly inhibit the use of genericity, since library writers would hesitate to migrate existing code.
Two method signatures m1 and m2 are override-equivalent iff either m1 is a subsignature of m2 or m2 is a subsignature of m1.
The example:
class Point implements Move {
int x, y;
abstract void move(int dx, int dy);
void move(int dx, int dy) { x += dx; y += dy; }
}
causes a compile-time error because it declares two move methods with the same (and hence, override-equivalent) signature. This is an error even though one of the declarations is abstract.
[/b]
link: http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.2
obrigado !