File tree 3 files changed +13
-6
lines changed
org.codehaus.groovy25/src/org/codehaus/groovy/ast
org.codehaus.groovy30/src/org/codehaus/groovy/ast
org.codehaus.groovy40/src/org/codehaus/groovy/ast
3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -775,14 +775,19 @@ public void addInterface(ClassNode type) {
775
775
}
776
776
}
777
777
778
- public boolean equals (Object o ) {
779
- // GRECLIPSE add
780
- if (o ==null ) return false ;
781
- // GRECLIPSE end
778
+ public boolean equals (final Object that ) {
779
+ /* GRECLIPSE edit -- GROOVY-10249, et al.
782
780
if (redirect!=null) return redirect().equals(o);
783
781
if (!(o instanceof ClassNode)) return false;
784
782
ClassNode cn = (ClassNode) o;
785
783
return (cn.getText().equals(getText()));
784
+ */
785
+ if (that == this ) return true ;
786
+ if (!(that instanceof ClassNode )) return false ;
787
+ if (redirect != null ) return redirect .equals (that );
788
+ if (componentType != null ) return componentType .equals (((ClassNode ) that ).componentType );
789
+ return ((ClassNode ) that ).getText ().equals (getText ()); // arrays could be "T[]" or "[LT;"
790
+ // GRECLIPSE end
786
791
}
787
792
788
793
public int hashCode () {
Original file line number Diff line number Diff line change @@ -735,7 +735,8 @@ public boolean equals(Object that) {
735
735
if (that == this ) return true ;
736
736
if (!(that instanceof ClassNode )) return false ;
737
737
if (redirect != null ) return redirect .equals (that );
738
- return (((ClassNode ) that ).getText ().equals (getText ()));
738
+ if (componentType != null ) return componentType .equals (((ClassNode ) that ).componentType );
739
+ return ((ClassNode ) that ).getText ().equals (getText ()); // arrays could be "T[]" or "[LT;"
739
740
}
740
741
741
742
public int hashCode () {
Original file line number Diff line number Diff line change @@ -766,7 +766,8 @@ public boolean equals(Object that) {
766
766
if (that == this ) return true ;
767
767
if (!(that instanceof ClassNode )) return false ;
768
768
if (redirect != null ) return redirect .equals (that );
769
- return (((ClassNode ) that ).getText ().equals (getText ()));
769
+ if (componentType != null ) return componentType .equals (((ClassNode ) that ).componentType );
770
+ return ((ClassNode ) that ).getText ().equals (getText ()); // arrays could be "T[]" or "[LT;"
770
771
}
771
772
772
773
@ Override
You can’t perform that action at this time.
0 commit comments