Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4917091

javac rejects array over 128 in length

XMLWordPrintable

    • b123
    • sparc
    • solaris_8
    • Verified

      While JVM spec limits the array size to 255,

      http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#41115
      > ------
      > The number of dimensions in an array is limited to 255 by the size of the
      > dimensions opcode of the multianewarray instruction and by the constraints
      > imposed on the multianewarray, anewarray, and newarray instructions by §4.8.2.
      > ------

      jdk 1.4 javac rejects an array that's over 128. Below is the test.

      > /java/re/j2se/1.4.2/arcchive/fcs/binaries/solaris-sparc/bin/javac Test.java
      Test.java:2: array type has too many dimensions
                  static Object expected = (Object)new Object
                                                   ^
      1 error

      public class Test {
                  static Object expected = (Object)new Object
                      [1/*001*/][1/*002*/][1/*003*/][1/*004*/][1/*005*/]
                      [1/*006*/][1/*007*/][1/*008*/][1/*009*/][1/*010*/]
                      [1/*011*/][1/*012*/][1/*013*/][1/*014*/][1/*015*/]
                      [1/*016*/][1/*017*/][1/*018*/][1/*019*/][1/*020*/]
                      [1/*021*/][1/*022*/][1/*023*/][1/*024*/][1/*025*/]
                      [1/*026*/][1/*027*/][1/*028*/][1/*029*/][1/*030*/]
                      [1/*031*/][1/*032*/][1/*033*/][1/*034*/][1/*035*/]
                      [1/*036*/][1/*037*/][1/*038*/][1/*039*/][1/*040*/]
                      [1/*041*/][1/*042*/][1/*043*/][1/*044*/][1/*045*/]
                      [1/*046*/][1/*047*/][1/*048*/][1/*049*/][1/*050*/]
                      [1/*051*/][1/*052*/][1/*053*/][1/*054*/][1/*055*/]
                      [1/*056*/][1/*057*/][1/*058*/][1/*059*/][1/*060*/]
                      [1/*061*/][1/*062*/][1/*063*/][1/*064*/][1/*065*/]
                      [1/*066*/][1/*067*/][1/*068*/][1/*069*/][1/*070*/]
                      [1/*071*/][1/*072*/][1/*073*/][1/*074*/][1/*075*/]
                      [1/*076*/][1/*077*/][1/*078*/][1/*079*/][1/*080*/]
                      [1/*081*/][1/*082*/][1/*083*/][1/*084*/][1/*085*/]
                      [1/*086*/][1/*087*/][1/*088*/][1/*089*/][1/*090*/]
                      [1/*091*/][1/*092*/][1/*093*/][1/*094*/][1/*095*/]
                      [1/*096*/][1/*097*/][1/*098*/][1/*099*/][1/*100*/]
                      [1/*101*/][1/*102*/][1/*103*/][1/*104*/][1/*105*/]
                      [1/*106*/][1/*107*/][1/*108*/][1/*109*/][1/*110*/]
                      [1/*111*/][1/*112*/][1/*113*/][1/*114*/][1/*115*/]
                      [1/*116*/][1/*117*/][1/*118*/][1/*119*/][1/*120*/]
                      [1/*121*/][1/*122*/][1/*123*/][1/*124*/][1/*125*/]
                      [1/*126*/][1/*127*/][1/*128*/][1/*129*/];
      }
      ###@###.### 10/25/04 21:57 GMT

            jjg Jonathan Gibbons
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: