Skip to content

Commit

Permalink
Copy the indentation code instead of requiring dep on jdt internal
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
robstryker committed Dec 5, 2023
1 parent 75116df commit bd03b51
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ public static StringBuilder printMethod(AbstractMethodDeclaration methodDeclarat
String rawJavadoc = docs.get(signature);
if (rawJavadoc != null) {
for (String line : rawJavadoc.split("\r?\n")) {
// TODO call this via reflection
ASTNode.printIndent(tab, output).append(line).append("\n");
printIndent(tab, output).append(line).append("\n");
}
}
}
Expand All @@ -89,15 +88,24 @@ public static StringBuffer printMethod(AbstractMethodDeclaration methodDeclarati
String rawJavadoc = docs.get(signature);
if (rawJavadoc != null) {
for (String line : rawJavadoc.split("\r?\n")) {
// TODO call this via reflection
ASTNode.printIndent(tab, output).append(line).append("\n");
printIndent(tab, output).append(line).append("\n");
}
}
}
// TODO call this via reflection
return methodDeclaration.print(tab, output);
}

private static StringBuilder printIndent(int indent, StringBuilder output) {
for (int i = indent; i > 0; i--) output.append(" "); //$NON-NLS-1$
return output;
}

private static StringBuffer printIndent(int indent, StringBuffer output) {
for (int i = indent; i > 0; i--) output.append(" "); //$NON-NLS-1$
return output;
}

private static class Signature {
static final String getSignature(SourceMethod sourceMethod) {
StringBuilder sb = new StringBuilder();
Expand Down

0 comments on commit bd03b51

Please sign in to comment.