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

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

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

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 598)

@lombokissues
Copy link
Author

👤 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
Copy link
Author

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

🔗 lomboktry.tar.gz

@lombokissues
Copy link
Author

👤 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
Copy link
Author

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

Issue #649 has been merged into this issue.

@lombokissues
Copy link
Author

👤 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
Copy link
Author

End of migration

lianhaijun pushed a commit to lianhaijun/lombok that referenced this issue May 8, 2020
…lombok#693)

*  Fix issue projectlombok#633
 - @Builder.Default doesn't causes a warning message now
 - partly rewrite LombokHighlightErrorFilter and its handler-utility classes
 - added test for issue 633
 - replace class.getName().replace("$", ".") onto class.getCanonicalName()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant