原来的项目经理在系统里写了个一万多行的枚举类。。。
用eclipse可以正常启动运作,但是用maven打包就会报错:代码过长。
有很多说法,但是我发现的最有价值的是这一段:
https://stackoverflow.com/questions/2546470/enum-exeeding-the-65535-bytes-limit-of-static-initializer-whats-best-to-do
Methods are not limited to 64K. There are other problems, such as that the exception table can only cover 64K, and that the most common jump instructions jump with 16 bits integers. But an enum static initializer doesn't need exception handlers and a better compiler knows to generate wide jump instructions. So it's really a limitation in Javac (number of enum constants - not in general), that can be fixed by just fixing javac.