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 200244 - Introduce Constant fails to qualify identifiers when replaced in a class annotation
Summary: Introduce Constant fails to qualify identifiers when replaced in a class anno...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.1
Hardware: PC Linux
: P4 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-19 21:28 UTC by Jesse Glick
Modified: 2016-07-07 07:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-07-19 21:28:32 UTC
@Ann(attr="hardcoded")
class C {}

=>

@Ann(attr=CONST)
class C {
  private static final String CONST = "hardcoded";
}

does not compile.

First, CONST must have package-private access; you can select this yourself in the wizard before the refactoring is performed, but it ought to just not offer private access as an option in this case.

Second, the value needs to be qualified since it is not inside the class body:

@Ann(attr=C.CONST)
class C {
  static final String CONST = "hardcoded";
}
Comment 1 Martin Balin 2016-07-07 07:18:09 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss