[jOOQ/jOOQ#9276] Consistently use same line terminators in generator
Also for the import list the Java / Scala generators now use the configured line terminator rather than a hardcoded terminator.
This commit is contained in:
parent
b2fa9936b8
commit
f1568d475a
@ -105,10 +105,18 @@ public abstract class GeneratorWriter<W extends GeneratorWriter<W>> {
|
||||
this.files.mkdirs(file.getParentFile());
|
||||
}
|
||||
|
||||
public String tabString() {
|
||||
return tabString;
|
||||
}
|
||||
|
||||
public void tabString(String string) {
|
||||
this.tabString = string.replace("\\t", "\t");
|
||||
}
|
||||
|
||||
public String newlineString() {
|
||||
return newlineString;
|
||||
}
|
||||
|
||||
public void newlineString(String string) {
|
||||
this.newlineString = string.replace("\\n", "\n").replace("\\r", "\r");
|
||||
}
|
||||
|
||||
@ -207,11 +207,11 @@ public class JavaWriter extends GeneratorWriter<JavaWriter> {
|
||||
String topLevelPackage = imp.split("\\.")[0];
|
||||
|
||||
if (!topLevelPackage.equals(previous))
|
||||
importString.append("\n");
|
||||
importString.append(newlineString());
|
||||
|
||||
importString.append("import ")
|
||||
.append(imp)
|
||||
.append(isScala ? "\n" : ";\n");
|
||||
.append(isScala ? "" : ";").append(newlineString());
|
||||
|
||||
previous = topLevelPackage;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user