The definitive solution will involve a relatively large static initialiser in Keys.java with static final members being initialised to values of members of nested classes. Each nested class is limited to a maximum of 500 members, staying on the safe side of static initialisation block sizes. An example can be seen attached to this e-mail (with blocks of a max of 10 members).
This is committed on GitHub and will be included in the next 2.4.0-SNAPSHOT. Early testing is very welcome Cheers Lukas 2012/5/31 Lukas Eder <[email protected]>: >> The Tables.java was ok. Not problems with it. >> Just the Keys.java. >> Splitting worked for now for me but if things grow >> I am sure we will run into the issue again. > > I guess, with a certain amount of keys, the generated code should look > like this: > > ----------------------------------------------------------------- > public static XXX KEY1; > public static XXX KEY2; > public static XXX KEY3; > ... > public static XXX KEY2000; > > static { > initialise1To1000(); > initialise1001To2000(); > } > > private static void initialise1To1000() { > KEY1 = ... > KEY2 = ... > KEY3 = ... > ... > } > > private static void initialise1001To2000() { > ... > KEY2000 = ... > } > ----------------------------------------------------------------- > > This kind of solution wouldn't allow for static final variables, > though. Let's consider Stack Overflow for other ideas: > http://stackoverflow.com/questions/10841732/how-to-circumvent-the-size-limit-of-a-static-initialiser-in-java-when-initialisi > > Cheers > Lukas
Keys.java
Description: Binary data
