< prev index next >
src/java.base/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java
Print this page
@@ -391,33 +391,26 @@
private TypeVariable<?> getTypeVariable() {
return (TypeVariable)getType();
}
- // For toString, the declaration of a type variable should
+ // The declaration of a type variable should
// including information about its bounds, etc. However, the
// use of a type variable should not. For that reason, it is
- // acceptable for the toString implementation of
+ // acceptable for the toString and hashCode implementations of
// AnnotatedTypeVariableImpl to use the inherited
- // implementation from AnnotatedTypeBaseImpl.
+ // implementations from AnnotatedTypeBaseImpl.
@Override
public boolean equals(Object o) {
if (o instanceof AnnotatedTypeVariable) {
AnnotatedTypeVariable that = (AnnotatedTypeVariable) o;
- return equalsTypeAndAnnotations(that) &&
- Arrays.equals(getAnnotatedBounds(), that.getAnnotatedBounds());
+ return equalsTypeAndAnnotations(that);
} else {
return false;
}
}
-
- @Override
- public int hashCode() {
- return baseHashCode() ^
- Objects.hash((Object[])getAnnotatedBounds());
- }
}
private static final class AnnotatedParameterizedTypeImpl extends AnnotatedTypeBaseImpl
implements AnnotatedParameterizedType {
AnnotatedParameterizedTypeImpl(ParameterizedType type, LocationInfo location,
< prev index next >