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 162484 - Error in rewriting of annotations
Summary: Error in rewriting of annotations
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-12 20:01 UTC by tronicek
Modified: 2016-07-07 07:17 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 tronicek 2009-04-12 20:01:08 UTC
I rewrite ModifiersTree:

            TreeMaker make = wc.getTreeMaker();
            List<AnnotationTree> ann = new ArrayList<AnnotationTree>();
            ann.add(ann1.get(1));
            ann.add(ann1.get(0));
            ModifiersTree t = make.Modifiers(fla2, ann);
            System.out.println("ann: " + ann);
            rewrite(node, t);

ann1 is the original list of annotations. The source:

@A1
@A2
class ListOfAnnotations {

    @A1 @A2
    static void m() { }
}


The output in the log is:

ann: [@A2(), @A1()]
original: @A1()
@A2()

modified: @A2()
@A1()

ann: [@A2(), @A1()]
original: @A1()
@A2()
static 
modified: @A2()
@A1()
static 

This is correct. However, the result is incorrect:

@A2
class ListOfAnnotations {

 @A2
    static void m() { }
}
Comment 1 Jan Lahoda 2009-08-20 10:02:16 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 2 David Strupl 2012-10-25 13:41:41 UTC
Bug prior to 7.0, not touched for the last 2 years --> P4.
Comment 3 Martin Balin 2016-07-07 07:17:22 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