Github user graemerocher commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/416#discussion_r78217077
  
    --- Diff: src/main/org/codehaus/groovy/transform/trait/TraitComposer.java 
---
    @@ -293,7 +293,8 @@ private static void createForwarderMethod(
     
             ClassNode[] exceptionNodes = 
correctToGenericsSpecRecurse(genericsSpec, 
copyExceptions(helperMethod.getExceptions()));
             ClassNode fixedReturnType = 
correctToGenericsSpecRecurse(genericsSpec, helperMethod.getReturnType());
    -        Expression forwardExpression = genericsSpec.isEmpty()?mce:new 
CastExpression(fixedReturnType,mce);
    +        boolean noCastRequired = genericsSpec.isEmpty() || 
fixedReturnType.getName().equals(ClassHelper.VOID_TYPE.getName());
    --- End diff --
    
    Just seemed more efficient. ClassNode.equals does this:
    
    ```groovy
        public boolean equals(Object o) {
            if (redirect!=null) return redirect().equals(o);
            if (!(o instanceof ClassNode)) return false;
            ClassNode cn = (ClassNode) o;
            return (cn.getText().equals(getText()));
        }
    ```
    
    The `getText()` method calls `getName()` anyway


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to