Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delomboked enum source doesn't respect emptyLines:blank format setting #664

Closed
lombokissues opened this issue Jul 14, 2015 · 4 comments
Closed

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 629)

@lombokissues
Copy link
Author

👤 steven676   🕗 Jan 16, 2014 at 01:54 UTC

When you delombok an enum, the resulting source code contains indented blank lines regardless of the value of the emptyLines format setting. For example, delomboking the following source

import lombok.RequiredArgsConstructor;

@ RequiredArgsConstructor
public enum Test {
FOO(1);

private final int foo;

}

with Lombok 1.12.4 with -f emptyLines:blank results in this (output run through sed -e's/ /_/g' to make problem more obvious):

//_Generated_by_delombok_at_Wed_Jan_15_17:52:18_PST_2014

public_enum_Test_{
____FOO(1);
____private_final_int_foo;


____@ java.lang.SuppressWarnings("all")
___private_Test(final_int_foo){
_______this.foo=_foo;
____}
}

This bug's the definition of "trivial" (come to think of it, I'm not entirely sure how I came across it in the first place), but it'd be nice to have the setting respected here.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Jan 19, 2014 at 05:51 UTC

Looking at the code, the cause is that printEnumBody prints its own statements, and should contain in the second loop the same check as printStats:

if (!suppressAlignmentForEmptyLines(l.head)) align();

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Jan 19, 2014 at 20:55 UTC

Fixed. You can already try it out using the latest edge release: https://projectlombok.org/download-edge.html

@lombokissues
Copy link
Author

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant