Idea cannot generate another constructor when @NoArgsConstructor is used
See original GitHub issueAssuming we have a class:
@NoArgsConstructor
public class NoArgsConstructorTest {
private String field;
}
Try to generate a constructor with field
argument (Code -> Generate -> Constructor
). Error message Constructor already exists
appears.
If you execute the same action with manually written no-args constructor, Idea opens a dialog to select fields to initialize in a new constructor:
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
@NoArgsConstructor, @RequiredArgsConstructor ...
Overview. This set of 3 annotations generate a constructor that will accept 1 parameter for certain fields, and simply assigns this parameter to...
Read more >intellij idea - To have lombok @Value, @NoArgsConstructor ...
I need @Value as I want fields to be immutable, and constructor annotations as ORM framework I am using needs both a no...
Read more >Constructor Already Exists, Can not create customize ...
IDEA -236421 Can't generate constructor with arguments on JPA-enabled classes ... to have another constructor with, say mandatory, fields present as well.
Read more >Why Default or No Argument Constructor is Important in Java ...
Almost all Java developers know that compiler adds a default constructor or better known as a no-argument constructor in every Java class, but...
Read more >Contexts and Dependency Injection - Quarkus
In CDI, a normal scoped bean must always declare a no-args constructor (this constructor is normally generated by the compiler unless you declare...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
still an issue
0.28-2019.3
This is again an issue with Version: 0.11.16