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

String[] + String[] gives Object[]

    XMLWordPrintableJSON

Details

    Description

      def a1 = ["a", "b"] as String[], a2 = ["c", "d"] as String[];
      def concatenated = a1 + a2;
      java.nio.file.Paths.get("parent", concatenated)
      

      ==>

      groovy.lang.MissingMethodException: No signature of method: static java.nio.file.Paths.get() is applicable for argument types: (java.lang.String, [Ljava.lang.Object;) values: [parent, [a, b, c, d]]
      Possible solutions: get(java.lang.String, [Ljava.lang.String;), get(java.net.URI), grep(), getAt(java.lang.String), wait(), any()
      	at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1373)
      	at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1359)
      	at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:50)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
      	at ideaGroovyConsole.run(ideaGroovyConsole.groovy:4)
      	at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:258)
      	at groovy.lang.GroovyShell.run(GroovyShell.java:502)
      	at groovy.lang.GroovyShell.run(GroovyShell.java:481)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:166)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
      	at console.run(console.txt:25)
      

      Attachments

        Activity

          People

            emilles Eric Milles
            dmovchinn Dmitry Ovchinnikov
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h