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

Eclipse assign parameter not in class body #295

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

Eclipse assign parameter not in class body #295

lombokissues opened this issue Jul 14, 2015 · 9 comments
Milestone

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 222)

@lombokissues
Copy link
Author

👤 middelkoop   🕗 Jun 21, 2011 at 11:25 UTC

What steps will reproduce the problem?

  1. Eclipse: create a class and annotate it with @ Data or @ Slf4j.
  2. Add a constructor with a parameter
  3. Use "Assign parameter to new field"

What is the expected output? What do you see instead?
The new field is created above the class declaration.

What version of the product are you using? On what operating system?
0.10.0-RC1, Windows XP, Eclipse Helios SR 2

Please provide any additional information below.
I didn't test other annotations, but I guess the problem exist there also. Maybe similar to Issue #228.

@lombokissues
Copy link
Author

👤 reinierz   🕗 Jun 21, 2011 at 14:15 UTC

A proper fix (vs the patchwork solution we applied for 155) for all these errors is rather complicated and involves tracking 2 positions for any given generated lombok node - where the code would have appeared if you typed it by hand, and the source annotation that caused it to be generated in the first place.

Then, we should patch 'jump to declaration' and friends to use the generating node, but set the position on the node itself to where it would have appeared. Right now we don't do this, so if we fix this, then 'go to declaration' would be broken and vice versa.

@lombokissues lombokissues added the accepted The issue/enhancement is valid, sensible, and explained in sufficient detail label Jul 14, 2015
@lombokissues
Copy link
Author

👤 Jappe.vanderHel   🕗 Nov 29, 2011 at 19:32 UTC

Can't reproduce this problem in the current edge release

@lombokissues
Copy link
Author

👤 middelkoop   🕗 Nov 30, 2011 at 08:41 UTC

I still can reproduce this with Eclipse Indigo SR 1 and Lombok 0.10.4.

Create this class:

@ Data
public class Test {

public Test(List<String> parameter1) {

}

}

Right-click on parameter1 and choose "Assign paramter to new field". The field is created above the @ Data annotation which is incorrect.

@lombokissues
Copy link
Author

👤 Jappe.vanderHel   🕗 Dec 01, 2011 at 07:42 UTC

Sorry, I should have provided the download link to clarify which edge-release I meant. https://projectlombok.org/download-edge.html

However I do see that the parameter has a generic type, maybe that causes the problem.

I'm working with Eclipse Indigo SR 1 as well.

@lombokissues
Copy link
Author

👤 Jappe.vanderHel   🕗 Dec 01, 2011 at 19:57 UTC

Tried your example with lombok 0.10.5 2011-11-28 18:49 UTC on Eclipse Indigo SP1, and it works for me. It should be fixed by the same bugfix that fixed Issue #124

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Dec 19, 2011 at 20:31 UTC

Fixed in de1bc35. Will be present in 0.10.6.

@lombokissues lombokissues removed the accepted The issue/enhancement is valid, sensible, and explained in sufficient detail label Jul 14, 2015
@lombokissues
Copy link
Author

👤 r.spilker   🕗 Dec 19, 2011 at 22:04 UTC

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

End of migration

lianhaijun pushed a commit to lianhaijun/lombok that referenced this issue May 8, 2020
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