Fix missing blank line between javadoc and params

dev/0.11
modmuss50 2021-11-01 18:30:42 +00:00
parent a91b75c05c
commit cb5c009e1a
1 changed files with 17 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -126,6 +127,10 @@ public class CFRObfuscationMapping extends NullMapping {
} }
} }
if (comment != null && !recordComponentDocs.isEmpty()) {
print(" * ");
}
for (String componentDoc : recordComponentDocs) { for (String componentDoc : recordComponentDocs) {
print(" * ").print(componentDoc).newln(); print(" * ").print(componentDoc).newln();
} }
@ -154,13 +159,23 @@ public class CFRObfuscationMapping extends NullMapping {
lines.addAll(Arrays.asList(comment.split("\\R"))); lines.addAll(Arrays.asList(comment.split("\\R")));
} }
for (MappingTree.MethodArgMapping arg : mapping.getArgs()) { final Collection<? extends MappingTree.MethodArgMapping> methodArgs = mapping.getArgs();
final List<String> params = new ArrayList<>();
for (MappingTree.MethodArgMapping arg : methodArgs) {
String argComment = arg.getComment(); String argComment = arg.getComment();
if (argComment != null) { if (argComment != null) {
lines.addAll(Arrays.asList(("@param " + arg.getSrcName() + " " + argComment).split("\\R"))); params.addAll(Arrays.asList(("@param " + arg.getSrcName() + " " + argComment).split("\\R")));
} }
} }
// Add a blank line between params and the comment.
if (!lines.isEmpty() && !params.isEmpty()) {
lines.add("");
}
lines.addAll(params);
} }
if (!lines.isEmpty()) { if (!lines.isEmpty()) {