-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@Data(staticConstructor = "of") doesn't create static Constructor #464
Comments
👤 BigMichi1 🕗 Jul 06, 2012 at 08:29 UTC What steps will reproduce the problem?
What is the expected output? What do you see instead? What version of the product are you using? On what operating system? Please provide any additional information below. |
👤 reinierz 🕗 Jul 10, 2012 at 23:08 UTC Cannot reproduce. This simple testcase: @ lombok.Data(staticConstructor="of") run through java -jar lombok.jar delombok -p Test.java shows that the static constructor IS showing up. Presumably there's something strange happening with your source code. Can you attach it in a comment? deadline before marking as invalid: July 21st, 2012. |
👤 BigMichi1 🕗 Jul 11, 2012 at 17:36 UTC my beans are defined in this way: import lombok.Data; import javax.annotation.Nonnull; @ Data(staticConstructor = "of") |
👤 r.spilker 🕗 Jul 16, 2012 at 11:21 UTC Could be related to issue #469 |
👤 reinierz 🕗 Jul 16, 2012 at 21:19 UTC Not related to issue #469. The problem is simple: When an explicit constructor annotation is present (i.e. @ NoArgsConstructor), @ Data just offloads all responsibilities to that parameter. Your code is buggy: You should use: @ Data instead of: @ Data(staticConstructor="of") Note that your confusion is entirely justified, as lombok silently ignores you. We've added a feature to @ Data that it will warn you that your 'staticConstructor' is going to do absolutely nothing in this scenario. This will be in 0.11.4, which will be released soon. |
👤 reinierz 🕗 Jul 16, 2012 at 22:21 UTC You can watch the warnings in action in the edge release: |
End of migration |
Migrated from Google Code (issue 391)
The text was updated successfully, but these errors were encountered: