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

mixing @ReqArgsC and @Data on inner classes breaks Organize Imports. #398

Closed
lombokissues opened this issue Jul 14, 2015 · 6 comments
Closed
Milestone

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 325)

@lombokissues
Copy link
Author

👤 reinierz   🕗 Jan 07, 2012 at 12:57 UTC

Paste following file into an eclipse project:

public class Outer {
@ lombok.RequiredArgsConstructor(staticName = "of")
static class Inner1 {
private final double value;
}

@ lombok.Data
static class Inner2 {
    private final double value;
}

}

and hit organize import (the shortcut, or, Source->Organize Imports). An error dialog appears with 'AST must not be null'.

The cause is our old friend, setSourceRange, barfing on whatever mix of -1 and 0 values it doesn't like.

Reported to work fine in 0.10.2 and broken in 0.10.4 and 0.10.6

Related forum discussion: https://groups.google.com/forum/﹟!topic/project-lombok/O1hVCF0WkkM

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Jan 09, 2012 at 21:12 UTC

RequiredArgsC is a red herring. The actual culprit are the parentheses after the annotation name. For example, using @ Getter() will cause the exact same error.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Jan 10, 2012 at 00:09 UTC

Looks like 5cc928f broke it. I think we should revert change the behavior of PatchFixed﹟fixRetrieveRightBraceOrSemiColonPosition to just return the original. This change was made to fix issue #336, where a save action would inadvertently add a final modifier to a field annotated with @ Setter. I think that that issue is less important than this one. I have been looking into creating a fix for both, but so far without success.

@lombokissues
Copy link
Author

👤 askoning   🕗 Jan 16, 2012 at 21:34 UTC

Reverted the old behaviour. We should take a better look at this problem later. Fixed in 7627d03

@lombokissues lombokissues added this to the 0.10.8 milestone Jul 14, 2015
@lombokissues
Copy link
Author

👤 reinierz   🕗 Jan 18, 2012 at 23:58 UTC

Jappe figured out how to fix it properly and reverted the revert. I was tempted to revert his reverting of the revert for poetry's sake, but, actually, it fixes everything, so, yeah. This will be in the any-day-now 0.10.8 release!

@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