< prev index next >

src/java.base/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java

Print this page

        

*** 391,423 **** private TypeVariable<?> getTypeVariable() { return (TypeVariable)getType(); } ! // For toString, 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 // AnnotatedTypeVariableImpl to use the inherited ! // implementation from AnnotatedTypeBaseImpl. @Override public boolean equals(Object o) { if (o instanceof AnnotatedTypeVariable) { AnnotatedTypeVariable that = (AnnotatedTypeVariable) o; ! return equalsTypeAndAnnotations(that) && ! Arrays.equals(getAnnotatedBounds(), that.getAnnotatedBounds()); } 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, --- 391,416 ---- private TypeVariable<?> getTypeVariable() { return (TypeVariable)getType(); } ! // 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 and hashCode implementations of // AnnotatedTypeVariableImpl to use the inherited ! // implementations from AnnotatedTypeBaseImpl. @Override public boolean equals(Object o) { if (o instanceof AnnotatedTypeVariable) { AnnotatedTypeVariable that = (AnnotatedTypeVariable) o; ! return equalsTypeAndAnnotations(that); } else { return false; } } } private static final class AnnotatedParameterizedTypeImpl extends AnnotatedTypeBaseImpl implements AnnotatedParameterizedType { AnnotatedParameterizedTypeImpl(ParameterizedType type, LocationInfo location,
< prev index next >