I found an issue with the generated *Tables classes
they all essentially look like this
public class ClassA {
public static final Object FIELD = new Object();
public static class InnerA {
public final static String INNER_FIELD = "Inner" + FIELD.getClass();
public final static String[] inner = {
INNER_FIELD
};
}
static {
InnerA.inner[0].getClass();
}
}
and if InnerA's initializer is called before ClassA's initializer you get a NPE at the array access
here is a stacktrace to illustrate the issue
Exception in thread "main" java.lang.ExceptionInInitializerError
at beep.ClassA$InnerA.<clinit>(ClassA.java:8)
at beep.Main.main(Main.java:10)
Caused by: java.lang.NullPointerException
at beep.ClassA.<clinit>(ClassA.java:16)
... 2 more
and this is exactly what happens when another *Tables class is initialized
i work around this by adding something like DependendTables.PACKAGE.getClass() before the array access, but this change is lost every time i regenerate
[Updated on: Thu, 13 February 2014 11:42]
Report message to a moderator