You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It writes a line break before each enum value but does not add one after the ;. This isn't a problem if there are any other type members to write because ElementPrinterHelper#writeElementList will add the line break (although there is no empty line then, but that breaks a test here due to the expected output:
I found some issues when writing enums:
is transformed into
This comes from the printList call here:
spoon/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
Line 753 in e8c0d1b
It writes a line break before each enum value but does not add one after the
;
. This isn't a problem if there are any other type members to write becauseElementPrinterHelper#writeElementList
will add the line break (although there is no empty line then, but that breaks a test here due to the expected output:spoon/src/test/java/spoon/test/prettyprinter/DefaultPrettyPrinterTest.java
Lines 303 to 311 in cd339e2
Only writing a new line if enum values were written but no type members makes it work.
preserveLineNumbers
writes an initial codeas
This only happens with that option, without the option it looks like
Note that without preserving line numbers, a new line is added before the method. This line is not added with that option but due to
spoon/src/main/java/spoon/reflect/visitor/ElementPrinterHelper.java
Lines 185 to 187 in 2fff4c5
Another - rather unrelated - issue I encountered with printing of enum values is that an enum
is written as
The added
()
and the;
also appear with the Sniper printer.Edit
The added
()
come from the!isImplicit
check herespoon/src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
Lines 795 to 797 in e8c0d1b
The text was updated successfully, but these errors were encountered: