Skip to content

Commit

Permalink
[record] Print compact constructor after class name
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawi01 authored and rspilker committed Apr 1, 2021
1 parent 462aedc commit 4637b9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/delombok/lombok/delombok/PrettyPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ private Name name_value(Name someName) {
print(tree.typarams, ", ");
print(">");
}

if (isRecord) printRecordConstructor(tree.defs);

JCTree extendsClause = getExtendsClause(tree);
if (extendsClause != null) {
print(" extends ");
Expand All @@ -542,8 +545,6 @@ private Name name_value(Name someName) {
print(tree.implementing, ", ");
}

if (isRecord) printRecordConstructor(tree.defs);

println(" {");
indent++;
printClassMembers(tree.defs, isEnum, isInterface);
Expand Down
3 changes: 3 additions & 0 deletions test/pretty/resource/after/Record.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public record Record<T>(T field) implements Cloneable {

}
4 changes: 4 additions & 0 deletions test/pretty/resource/before/Record.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// version 14:
public record Record<T>(T field) implements Cloneable {

}

0 comments on commit 4637b9d

Please sign in to comment.