Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4745

ClassNode.equals throws ClassCastException for object of other type

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.1, 1.7.11
    • Component/s: None
    • Labels:
      None
    • Environment:
      groovy 1.7.8

      Description

      ClassNode.equals(Object o) should check for different types and return false. Current Code:

       public boolean equals(Object o) {
              if (redirect!=null) return redirect().equals(o);
              ClassNode cn = (ClassNode) o;
              return (cn.getName().equals(getName()));
          }
      

      is obviously wrong.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              johanneslink Johannes Link
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: