question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Idea cannot generate another constructor when @NoArgsConstructor is used

See original GitHub issue

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

image

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:

image

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tarekbazinecommented, Dec 25, 2019

still an issue 0.28-2019.3

1reaction
orange-buffalocommented, Jun 28, 2016

This is again an issue with Version: 0.11.16

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found