[#2212] "code size too large" in generated SchemaImpl, when the number
of tables exceeds 15k
This commit is contained in:
parent
c8aac299fe
commit
682f844709
@ -1616,8 +1616,19 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
out.println();
|
||||
out.tab(1).override();
|
||||
out.tab(1).println("public final %s<%s%s> get%ss() {", List.class, type, generic, type.getSimpleName());
|
||||
out.tab(2).println("return %s.<%s%s>asList([[before=\n\t\t\t][separator=,\n\t\t\t][%s]]);", Arrays.class, type, generic, references);
|
||||
out.tab(2).println("%s result = new %s();", List.class, ArrayList.class);
|
||||
for (int i = 0; i < definitions.size(); i += INITIALISER_SIZE) {
|
||||
out.tab(2).println("result.addAll(get%ss%s());", type.getSimpleName(), i / INITIALISER_SIZE);
|
||||
}
|
||||
out.tab(2).println("return result;");
|
||||
out.tab(1).println("}");
|
||||
|
||||
for (int i = 0; i < definitions.size(); i += INITIALISER_SIZE) {
|
||||
out.println();
|
||||
out.tab(1).println("private final %s<%s%s> get%ss%s() {", List.class, type, generic, type.getSimpleName(), i / INITIALISER_SIZE);
|
||||
out.tab(2).println("return %s.<%s%s>asList([[before=\n\t\t\t][separator=,\n\t\t\t][%s]]);", Arrays.class, type, generic, references.subList(i, Math.min(i + INITIALISER_SIZE, references.size())));
|
||||
out.tab(1).println("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user