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

    https://github.com/apache/groovy/pull/214#discussion_r47792579
  
    --- Diff: 
src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java ---
    @@ -1574,9 +1560,9 @@ private static boolean 
equalIncludingGenerics(ClassNode orig, ClassNode copy) {
             if (orig.isGenericsPlaceHolder()!=copy.isGenericsPlaceHolder()) 
return false;
             if (!orig.equals(copy)) return false;
             GenericsType[] gt1 = orig.getGenericsTypes();
    -        GenericsType[] gt2 = orig.getGenericsTypes();
    -        if ((gt1==null || gt2==null) && gt1!=gt2) return false;
    +        GenericsType[] gt2 = copy.getGenericsTypes();
             if (gt1==gt2) return true;
    +        if (gt1 == null || gt2 == null) return false;
    --- End diff --
    
    Ah well, the intent was actually more obscure for me in the original. If 
you want a more expressive statement, I'd have found it clearer written like:
    
        if ((gt1 == null && gt2 != null) || (gt1 != null && gt2 == null)) 
return false;
    
    or
    
        if ((gt1 == null) ^ (gt2 == null)) return false;
    
    Still, the `null == null` case is handled by `gt1 == gt2` in any case, 
whether it comes first or second.
    
    I'm not especially attached to the modification, though.


---
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