From 1d55e5a329ef29261dcea909b568b59111a5ec33 Mon Sep 17 00:00:00 2001 From: Sander Ploegsma Date: Sat, 3 Feb 2024 10:59:11 +0100 Subject: [PATCH] fix: Add extra newline after printing enum values (#5649) --- .../java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java | 1 + .../java/spoon/test/prettyprinter/DefaultPrettyPrinterTest.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java b/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java index 91fcd2ad4e0..b79f2c267a3 100644 --- a/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java +++ b/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java @@ -797,6 +797,7 @@ public > void visitCtEnum(CtEnum ctEnum) { printer.writeln(); scan(enumValue); }); + printer.writeln(); } elementPrinterHelper.writeElementList(ctEnum.getTypeMembers()); diff --git a/src/test/java/spoon/test/prettyprinter/DefaultPrettyPrinterTest.java b/src/test/java/spoon/test/prettyprinter/DefaultPrettyPrinterTest.java index 3a4527b701f..716c7b40f44 100644 --- a/src/test/java/spoon/test/prettyprinter/DefaultPrettyPrinterTest.java +++ b/src/test/java/spoon/test/prettyprinter/DefaultPrettyPrinterTest.java @@ -294,7 +294,7 @@ public void autoImportUsesFullyQualifiedNameWhenImportedNameAlreadyPresent() { expected = "public enum ENUM {" + nl + nl - + " E1(spoon.test.prettyprinter.testclasses.sub.TypeIdentifierCollision.globalField, spoon.test.prettyprinter.testclasses.sub.TypeIdentifierCollision.ENUM.E1);" + nl + + " E1(spoon.test.prettyprinter.testclasses.sub.TypeIdentifierCollision.globalField, spoon.test.prettyprinter.testclasses.sub.TypeIdentifierCollision.ENUM.E1);" + nl + nl + " final int NUM;" + nl + nl + " final Enum e;" + nl + nl + " private ENUM(int num, Enum e) {" + nl