Skip to content

Commit

Permalink
Fix class and method comments being at the end instead of the beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Jan 21, 2020
1 parent 00c5b1a commit 74b36cc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@ private void writeHeader(TinyHeader header) {
private void writeClass(TinyClass tinyClass) {
writeLine(Indents.CLASS, tinyClass.getClassNames(), Prefixes.CLASS);

for (String comment : tinyClass.getComments()) writeComment(Indents.CLASS_COMMENT, comment);

tinyClass.getMethods().stream().sorted().forEach(this::writeMethod);
tinyClass.getFields().stream().sorted().forEach(this::writeField);

for (String comment : tinyClass.getComments()) writeComment(Indents.CLASS_COMMENT, comment);

}

private void writeMethod(TinyMethod method) {
writeLine(Indents.METHOD, method.getMethodNames(), Prefixes.METHOD, method.getMethodDescriptorInFirstNamespace());

for (String comment : method.getComments()) writeComment(Indents.METHOD_COMMENT, comment);

method.getParameters().stream().sorted().forEach(this::writeMethodParameter);
method.getLocalVariables().stream().sorted().forEach(this::writeLocalVariable);

for (String comment : method.getComments()) writeComment(Indents.METHOD_COMMENT, comment);

}

private void writeMethodParameter(TinyMethodParameter parameter) {
Expand Down

0 comments on commit 74b36cc

Please sign in to comment.