Skip to content

Commit

Permalink
Use setJavadoc instead of accumulating.
Browse files Browse the repository at this point in the history
  • Loading branch information
silvio2402 committed Sep 26, 2024
1 parent ab9e6b9 commit bbce4a4
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private static void writeRegionCodeConstantsToJavaFile(Collection<String> region
.setModifiers("final")
.setCopyright(Integer.parseInt(copyright));

writer.addToJavadoc(REGION_CODE_CONSTS_JAVADOC);
writer.setJavadoc(REGION_CODE_CONSTS_JAVADOC);

for (String regionCode : regionCodeList) {
String variableName = regionCode.toUpperCase();
Expand Down Expand Up @@ -423,13 +423,7 @@ final Builder addToImports(String name) {
return this;
}

abstract Builder setJavadoc(String javadoc);
private final StringBuilder javadocBuilder = new StringBuilder();
final Builder addToJavadoc(String text) {
javadocBuilder.append(text);
return this;
}

abstract Builder setJavadoc(String javadoc);
abstract Builder setName(String name);
abstract Builder setModifiers(String modifiers);

Expand All @@ -448,7 +442,6 @@ final Builder formatToBody(String format, Object... args) {
abstract ClassWriter autoBuild();

final ClassWriter build() {
setJavadoc(javadocBuilder.toString());
setBody(bodyBuilder.toString());
return autoBuild();
}
Expand Down

0 comments on commit bbce4a4

Please sign in to comment.