groovy
  1. groovy
  2. GROOVY-3366

reduce method variants in org.codehaus.groovy.runtime.ArrayUtil

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.6-beta-2, 1.6-rc-1, 1.6-rc-2, 1.6-rc-3, 1.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I noticed that the -docs bundle is unzipped to a humongous 85 MB.

      Drilling down a bit, I found this beastie:

      robert@nazgul:/usr/share/doc/packages/groovy/html/api/org/codehaus/groovy/runtime> ll -h ArrayUtil.html
      -rw-r--r-- 1 root root 12M 2009-02-18 23:31 ArrayUtil.html
      

      Seems lather large to me, perhaps this is an error?

        Issue Links

          Activity

          Hide
          blackdrag blackdrag added a comment -

          ArrayUtil is a class with many many methods. The way it is used it can be easily replaced with a single method that takes a varags Object and returns the array. In 1.4 code he class had its use I guess, but now it no longer has

          Show
          blackdrag blackdrag added a comment - ArrayUtil is a class with many many methods. The way it is used it can be easily replaced with a single method that takes a varags Object and returns the array. In 1.4 code he class had its use I guess, but now it no longer has
          Hide
          blackdrag blackdrag added a comment -

          I changed the title of this issue, because this reflects much better a report

          Show
          blackdrag blackdrag added a comment - I changed the title of this issue, because this reflects much better a report
          Hide
          Peter Niederwieser added a comment -

          Can this be fixed now?

          Show
          Peter Niederwieser added a comment - Can this be fixed now?
          Hide
          blackdrag blackdrag added a comment -

          As the javadoc of the class says there is one usage for this class, so I did not fully make up my mind about this issue yet. If you want a change now, then I suggest you make a patch.

          Show
          blackdrag blackdrag added a comment - As the javadoc of the class says there is one usage for this class, so I did not fully make up my mind about this issue yet. If you want a change now, then I suggest you make a patch.
          Hide
          Peter Niederwieser added a comment - - edited

          My concrete problem is this:

          def foo(int[] args) { ... }
          
          foo(1,2,3,4, ...)
          

          Around 255 args, you start to get one of these errors (depending on the exact number of arguments):

          • java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.ArrayUtil.createArray (runtime error)
          • java.lang.ArrayIndexOutOfBoundsException at org.codehaus.groovy.classgen.AsmClassGenerator.getCreateArraySignature(AsmClassGenerator.java:2225) (compile-time error)

          Don't know why Gradle users write such scripts. But anyway, it would be better to do away with this limit, unless there are good reasons for it.

          Show
          Peter Niederwieser added a comment - - edited My concrete problem is this: def foo( int [] args) { ... } foo(1,2,3,4, ...) Around 255 args, you start to get one of these errors (depending on the exact number of arguments): java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.ArrayUtil.createArray (runtime error) java.lang.ArrayIndexOutOfBoundsException at org.codehaus.groovy.classgen.AsmClassGenerator.getCreateArraySignature(AsmClassGenerator.java:2225) (compile-time error) Don't know why Gradle users write such scripts. But anyway, it would be better to do away with this limit, unless there are good reasons for it.
          Hide
          blackdrag blackdrag added a comment -

          yes I noticed today, that ArrayUtil supports up to 250 arguments and that there is nothing for more. But that is actually a different issue than the one here. Solving the one here can be used to solve that one as well of course, but the issue you describe could be solved without resolving this one here as well

          Show
          blackdrag blackdrag added a comment - yes I noticed today, that ArrayUtil supports up to 250 arguments and that there is nothing for more. But that is actually a different issue than the one here. Solving the one here can be used to solve that one as well of course, but the issue you describe could be solved without resolving this one here as well
          Hide
          blackdrag blackdrag added a comment -

          There is actual also a limit of arguments a method can take through the JVM. So I think it is ok to have this limit here as well. We decided to remove the class completely in Groovy 3, see GROOVY-5483 for this

          Show
          blackdrag blackdrag added a comment - There is actual also a limit of arguments a method can take through the JVM. So I think it is ok to have this limit here as well. We decided to remove the class completely in Groovy 3, see GROOVY-5483 for this

            People

            • Assignee:
              blackdrag blackdrag
              Reporter:
              Robert Munteanu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: