You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Nathan Harvey (JIRA)" <ji...@apache.org> on 2017/12/14 00:11:00 UTC

[jira] [Created] (GROOVY-8414) Equality check of sets with nested array causes MissingMethodException

Nathan Harvey created GROOVY-8414:
-------------------------------------

             Summary: Equality check of sets with nested array causes MissingMethodException
                 Key: GROOVY-8414
                 URL: https://issues.apache.org/jira/browse/GROOVY-8414
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 2.5.0-beta-2, 3.0.0-alpha-1
            Reporter: Nathan Harvey


Given the following code:
{code}
def obj = new Object()
assert [obj, []] as Set == [obj, ['a', 'b'] as String[]] as Set
{code}

The following error is (sometimes) encountered:
{code}
groovy.lang.MissingMethodException: No signature of method: java.lang.Object.equals() is applicable for argument types: (String, String) values: [a, b]
Possible solutions: equals(java.lang.Object), getClass()
{code}

This does not seem to impact Lists. It only occurs with the collection of {{['a', 'b']}} being cast to {{String[]}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)