Java Compile error: Parameter x is exceeding the limit of 255 words

前端 未结 3 1177
粉色の甜心
粉色の甜心 2021-01-18 15:32

I have a constructor (for an auto generated class) that has 255 paremeters. Using ant on linux with javac 1.6.0_02. The class compiles fine and everything is good.

H

3条回答
  •  囚心锁ツ
    2021-01-18 16:12

    Well, the class file spec. says:

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

提交回复
热议问题