Java compilation error: x parameter exceeds 255 word limit

I have a constructor (for an automatically generated class) that has 255 parameters. Using ant on linux with javac 1.6.0_02. The class compiles fine, and all is well.

However, when I try to compile the same class from eclipse on windows xp using jdk 1.6, I get the following error

Too many parameters, parameter BLAH is exceeding the limit of 255 words eligible for method parameters

BLAH is the 256th parameter.

Is there any way to overcome this problem? Changing an automatically generated class is not an option, since I will need to change it when compiling or changing the generator. Both options are unacceptable because we can already get this class on Linux.

PS: For those interested, the java class is generated from an IDL file using JacORB. Unfortunately, the number of parameters in a class cannot be reduced, because it defines the interfaces between our software and other systems.

+5
source share
3 answers

Well, you violate the VM specification , section 4.10 :

255 (. 4.3.3), . , long double , .

... , Linux, . , -, , , .

, , .

+14

:

  • , . .
  • , 3 4 , 1 -.
+2

, :

A method descriptor is valid only if it represents method parameters with a total length of 255 or less, where this length includes a contribution for this in the case of an instance method or interface calls. The total length is calculated by summing the contributions of individual parameters, where a parameter of type long or double contributes two units in length and a parameter of any other type contributes one unit.

+1
source

All Articles