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.
Any attempt to modify anonymous class members like method rename, or addition/deletion of statements to member methods fails If you look into CasualDiff.treesMatch(), in case of JCTree.CLASSDEF, its members are not matched deeply and hence the diffs are empty in the above mentioned scenarios. Following the pattern used in CasualDiff- I think it is necessary to provide matchClass(), matchMethod(), matchVariable() implementation and call them appropriately in order to fix this bug
Do you have current trunk sources? Recently I fixed similar issue, see #96364. -- If you have anonymous class, perhaps 'case JCTree.NEWCLASS' is used.
Fix to #96364 addresses only the modification to NewClassTree's body class. (For example, when you add a method) It doesn't work if you want to add a statement to the member method.
Okay, now I see your point. List of members are matched as the same, but there are changes inside the members. Thanks, I'll try to address the issue next week.
Reproducible testcase added. Checking in test/unit/src/org/netbeans/api/java/source/gen/AnonymousClassTest.java; /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/AnonymousClassTest.java,v <-- AnonymousClassTest.java new revision: 1.2; previous revision: 1.1 done
Hopefully fixed. Please, verify. Checking in src/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.84; previous revision: 1.83 done
Thanks, I have verified that your fix addresses the VWP issue which is to add a statement to a method in an anonymous inner class.