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

Comments

Projects
None yet
1 participant
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 222)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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.

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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.

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Can't reproduce this problem in the current edge release

Collaborator

lombokissues commented Jul 14, 2015

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

Can't reproduce this problem in the current edge release

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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.

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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.

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Fixed in de1bc35. Will be present in 0.10.6.

Collaborator

lombokissues commented Jul 14, 2015

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

Fixed in de1bc35. Will be present in 0.10.6.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

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

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment