Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1642

JVM Spec Violation 255 Parameter Limit Exceeded



    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.7.7
    • Fix Version/s: 1.8.1
    • Component/s: java
    • Labels:
    • Environment:

      Windows/Linux all Java

    • Tags:
      JVM Spec Violation


      The JVM Spec indicates that:

      The number of method parameters is limited to 255 by the definition of a method descriptor (ยง4.3.3), where the limit includes one unit for this in the case of instance or interface method invocations. Note that a method descriptor is defined in terms of a notion of method parameter length in which a parameter of type long or double contributes two units to the length, so parameters of these types further reduce the limit.

      Avro Generated Java code with say more than 255 fields will create a constructor that is not valid and won't compile.

      Simple test is to create a 256 field avro schema, use the avro-maven auto code gen plugin, and try to compile the resulting class.

      DON'T use linux when doing this use windows, my suspicion is that Linux JavaC generates invalid byte code but does not complain.
      Windows will correctly complain indicating that you are a violator of the JVM specification.


        1. AVRO-1642-0.patch
          52 kB
          Prateek Rungta
        2. AVRO-1642-1.patch
          42 kB
          Prateek Rungta
        3. avro-1642-fail.tar
          23 kB
          Prateek Rungta

          Issue Links



              • Assignee:
                barryjones Barry Jones
                u912boilermaker Bryce Alcock
              • Votes:
                1 Vote for this issue
                7 Start watching this issue


                • Created: