Groovy
  1. Groovy
  2. GROOVY-3366

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

    Details

    • Type: Improvement Improvement
    • Status: 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

      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

          Robert Munteanu created issue -
          Hide
          Jochen Theodorou 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
          Jochen Theodorou 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
          Jochen Theodorou added a comment -

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

          Show
          Jochen Theodorou added a comment - I changed the title of this issue, because this reflects much better a report
          Jochen Theodorou made changes -
          Field Original Value New Value
          Fix Version/s 1.6.1 [ 14852 ]
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Affects Version/s 1.6-beta-2 [ 14261 ]
          Summary org.codehaus.groovy.runtime.ArrayUtil javadoc is huge reduce method variants in org.codehaus.groovy.runtime.ArrayUtil
          Affects Version/s 1.6-rc-3 [ 14913 ]
          Affects Version/s 1.6-rc-1 [ 14009 ]
          Affects Version/s 1.6-rc-2 [ 13832 ]
          Jochen Theodorou made changes -
          Assignee Jochen Theodorou [ blackdrag ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6.2 [ 15151 ]
          Fix Version/s 1.6.1 [ 14852 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6.2 [ 15151 ]
          Fix Version/s 1.6.3 [ 15251 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.7-beta-1 [ 14014 ]
          Fix Version/s 1.6.3 [ 15251 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.7-beta-1 [ 14014 ]
          Fix Version/s 1.7-beta-x [ 15538 ]
          Guillaume Delcroix made changes -
          Link This issue is related to GROOVY-4157 [ GROOVY-4157 ]
          Hide
          Peter Niederwieser added a comment -

          Can this be fixed now?

          Show
          Peter Niederwieser added a comment - Can this be fixed now?
          Hide
          Jochen Theodorou 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
          Jochen Theodorou 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
          Jochen Theodorou 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
          Jochen Theodorou 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
          Jochen Theodorou 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
          Jochen Theodorou 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
          Jochen Theodorou made changes -
          Fix Version/s 1.7.x [ 15538 ]
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12732360 ] Default workflow, editable Closed status [ 12744204 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12970208 ] Default workflow, editable Closed status [ 12977982 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          1205d 16h 37m 1 Jochen Theodorou 08/Jun/12 09:36

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development