File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 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) {
775775 }
776776 }
777777
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.
782780 if (redirect!=null) return redirect().equals(o);
783781 if (!(o instanceof ClassNode)) return false;
784782 ClassNode cn = (ClassNode) o;
785783 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
786791 }
787792
788793 public int hashCode () {
Original file line number Diff line number Diff line change @@ -735,7 +735,8 @@ public boolean equals(Object that) {
735735 if (that == this ) return true ;
736736 if (!(that instanceof ClassNode )) return false ;
737737 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;"
739740 }
740741
741742 public int hashCode () {
Original file line number Diff line number Diff line change @@ -766,7 +766,8 @@ public boolean equals(Object that) {
766766 if (that == this ) return true ;
767767 if (!(that instanceof ClassNode )) return false ;
768768 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;"
770771 }
771772
772773 @ Override
You can’t perform that action at this time.
0 commit comments