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

Delombok makes "+=" in Assignments to "="; will lead to broken code #633

Closed
lombokissues opened this Issue Jul 14, 2015 · 6 comments

Comments

Projects
None yet
1 participant
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 598)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 KrokodilSchnappi   🕗 Oct 23, 2013 at 13:05 UTC

What steps will reproduce the problem?

  1. write a Java class with lombok annotations and a method containing a '+=' assignment. In the attached tgz in File src/exp/ASimpleValue.java line 13 you can see the example
  2. run delombok on the source file

What is the expected output?

expected output is the 'delomboked' code at the end of the source file, the body of the method getCalculatedValue() should be unchanged

What do you see instead?

delombok makes the line
ret += 1;
to
ret = 1;

(in attached tgz it is the file src-delomboked/exp/ASimpleValue.java line 9)

What version of the product are you using? On what operating system?

  • lombok v1.1.12
  • Output of java -version:
    java version "1.7.0_25"
    OpenJDK Runtime Environment (fedora-2.3.12.1.fc17-x86_64)
    OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
  • Operating System: Fedora 17, Kernel 3.9.10-100
Collaborator

lombokissues commented Jul 14, 2015

👤 KrokodilSchnappi   🕗 Oct 23, 2013 at 13:05 UTC

What steps will reproduce the problem?

  1. write a Java class with lombok annotations and a method containing a '+=' assignment. In the attached tgz in File src/exp/ASimpleValue.java line 13 you can see the example
  2. run delombok on the source file

What is the expected output?

expected output is the 'delomboked' code at the end of the source file, the body of the method getCalculatedValue() should be unchanged

What do you see instead?

delombok makes the line
ret += 1;
to
ret = 1;

(in attached tgz it is the file src-delomboked/exp/ASimpleValue.java line 9)

What version of the product are you using? On what operating system?

  • lombok v1.1.12
  • Output of java -version:
    java version "1.7.0_25"
    OpenJDK Runtime Environment (fedora-2.3.12.1.fc17-x86_64)
    OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
  • Operating System: Fedora 17, Kernel 3.9.10-100
@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 KrokodilSchnappi   🕗 Oct 23, 2013 at 13:05 UTC

🔗 lomboktry.tar.gz

Collaborator

lombokissues commented Jul 14, 2015

👤 KrokodilSchnappi   🕗 Oct 23, 2013 at 13:05 UTC

🔗 lomboktry.tar.gz

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Oct 27, 2013 at 21:36 UTC

Yup, dang. I thought we had a test for this; we broke this during the modifications to handle new code in javac8.

Well, we have tests for it now, and this issue has been fixed.

Edge release is here: https://projectlombok.org/download-edge.html

We'll probably release a new official version quite soon; this is a major issue that shouldn't be in a stable release.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Oct 27, 2013 at 21:36 UTC

Yup, dang. I thought we had a test for this; we broke this during the modifications to handle new code in javac8.

Well, we have tests for it now, and this issue has been fixed.

Edge release is here: https://projectlombok.org/download-edge.html

We'll probably release a new official version quite soon; this is a major issue that shouldn't be in a stable release.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 r.spilker   🕗 Dec 11, 2013 at 18:22 UTC

Issue #649 has been merged into this issue.

Collaborator

lombokissues commented Jul 14, 2015

👤 r.spilker   🕗 Dec 11, 2013 at 18:22 UTC

Issue #649 has been merged into this issue.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Jan 15, 2014 at 21:26 UTC

This fix is now part of the latest official release. 1.12.4 was just pushed for download and to maven central.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Jan 15, 2014 at 21:26 UTC

This fix is now part of the latest official release. 1.12.4 was just pushed for download and to maven central.

@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