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.
In my particular case I added the class annotation, then I added a method. The method in final java source is missing : public void run(WorkingCopy workingCopy) throws java.io.IOException { // get the original class ClasssTree class1 = ... // create annotation and add it to class1 ClasssTree class2 = ... // create method and add it to class2 ClasssTree class3 = ... // rewrite workingCopy.rewrite(class1, class3); }
Created attachment 36793 [details] Modified tutorial test : testAddMethod
My issue. Thanks for the test.
*** Issue 91675 has been marked as a duplicate of this issue. ***
It is not directly caused by two changes in one modification task - it definitely works, refactoring in some cases provides correct results. From my current observation, I see these two causes: i) when annotation is added, ImmutableTreeTranslator does not copy position from old class tree to new one. Generator then detects then old class disappeared and new was added. The new tree is then whole written instead of looking for minimal changes. Observable when you have some comments inside. ii) When whole class is printed, syntetic constructor is improperly detected I think. I do not know details right now, but in my test new default constructor appeared and method was missing. This is caused by really annoying feature, that also syntetic things are in the tree, but they do not have mapped elements in source. When i) is fixed, this issue should not be reproducible, but also ii) should be fixed.
This issue blocks generation of entity classes and because it is important functionality for M6 I marked this issue as milestone stopper
Checking in org/netbeans/modules/java/source/save/CasualDiff.java; /cvs/java/source/src/org/netbeans/modules/java/source/save/CasualDiff.java,v <-- CasualDiff.java new revision: 1.30; previous revision: 1.29 done
Test Checking in cfg-unit.xml; /cvs/java/source/test/cfg-unit.xml,v <-- cfg-unit.xml new revision: 1.10; previous revision: 1.9 done RCS file: /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/TwoModificationsTest.java,v done Checking in unit/src/org/netbeans/api/java/source/gen/TwoModificationsTest.java; /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/TwoModificationsTest.java,v <-- TwoModificationsTest.java initial revision: 1.1 done
Thanks many times. BTW, why don't these tests run on a daily basis? I don't see them anywhere in the nightly test results.
Because nobody put them out. I can consider about publishing some subset of them.