Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 206957 - WorkingCopy.rewrite strips off qualifying prefix on annotation
WorkingCopy.rewrite strips off qualifying prefix on annotation
Product: java
Classification: Unclassified
Component: Source
PC Linux
: P3 (vote)
: 7.2
Assigned To: Jan Lahoda
: 208333 (view as bug list)
Depends on:
Blocks: 206954
  Show dependency treegraph
Reported: 2012-01-05 19:14 UTC by Jesse Glick
Modified: 2012-08-20 12:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2012-01-05 19:14:44 UTC
As part of bug #206954 I am writing an editor hint which creates a @NavigatorPanel.Registration and adds it to a class implementing NavigatorPanel. I create a new ModifiersTree with the annotation, whose toString is e.g.

@org.netbeans.spi.navigator.NavigatorPanel.Registration(mimeType = "image/png")

and call WorkingCopy.rewrite. But the result is e.g.

import org.netbeans.spi.navigator.NavigatorPanel;
@Registration(mimeType = "image/png")
public class ImageNavigatorPanel implements NavigatorPanel {...}

which does not compile until you add the "NavigatorPanel." prefix or Fix Imports to import the nested type.

This happens whether or not I call GeneratorUtilities.importFQNs.

I suspect that the problem is that the annotation is a member of the annotated element's supertype. But of course the annotation would only become in scope as a result of this if it were inside the class body.
Comment 1 Quality Engineering 2012-01-07 16:20:47 UTC
Integrated into 'main-golden', will be available in build *201201070601* on (upload may still be in progress)
User: Jan Lahoda <>
Log: #206957: elements visible through extends/implements are visible only inside class body
Comment 2 Jan Lahoda 2012-02-17 15:34:23 UTC
And also:
Comment 3 Jan Lahoda 2012-02-17 15:35:15 UTC
*** Bug 208333 has been marked as a duplicate of this bug. ***
Comment 4 ttokoly 2012-08-20 12:24:57 UTC
Product Version: NetBeans IDE Dev (Build 201208190001)
Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09
System: Windows 7 version 6.1 running on x86; Cp1250; en_US (nb)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo