This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 206581 - Code completion shows default constructor even if nondefault is created using annotation processor
Summary: Code completion shows default constructor even if nondefault is created using...
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 15:33 UTC by crazyjavahacking
Modified: 2012-03-26 22:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
bug proof (87.52 KB, image/png)
2011-12-20 15:33 UTC, crazyjavahacking
Details

Note You need to log in before you can comment on or make changes to this bug.
Description crazyjavahacking 2011-12-20 15:33:02 UTC
Created attachment 114363 [details]
bug proof

Code completion does not respect the state when non-default constructor is generated using annotation processor, it provides both.

Using project Lombok:

@AllArgsConstructor(access= AccessLevel.PACKAGE)
public final class EdgeModel {
    private final String transitionName;
}

code completion shows both Lombok's generated constructor + default one as well
Comment 1 Dusan Balek 2012-01-10 10:26:54 UTC
The problem is that the automatically generated default constructor is removed from the class by Lombok - however the constructor is removed from the AST only and not from the corresponding ClassSymbol's scope.
Comment 2 crazyjavahacking 2012-01-10 11:19:53 UTC
And could this be solved on Project Lombok's side?
Comment 3 Jan Lahoda 2012-02-07 16:56:07 UTC
(In reply to comment #2)
> And could this be solved on Project Lombok's side?

Can probably be fixed in Lombok, by removing the extra default constructor from the parent (class) Scope.
Comment 4 R.Spilker 2012-03-26 22:14:52 UTC
I am a Project Lombok developer. We've just fixed the problem. It will be part of the upcoming release. See also http://code.google.com/p/projectlombok/issues/detail?id=326