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 97501 - Anonymous inner class members and its childs cannot be modified
Summary: Anonymous inner class members and its childs cannot be modified
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Pavel Flaska
Depends on:
Blocks: 90451
  Show dependency tree
Reported: 2007-03-08 19:41 UTC by _ deva
Modified: 2007-03-14 00:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description _ deva 2007-03-08 19:41:52 UTC
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
Comment 1 Pavel Flaska 2007-03-08 21:26:51 UTC
Do you have current trunk sources? Recently I fixed similar issue, see #96364.
-- If you have anonymous class, perhaps 'case JCTree.NEWCLASS' is used. 
Comment 2 _ deva 2007-03-08 21:35:04 UTC
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.
Comment 3 Pavel Flaska 2007-03-08 22:47:15 UTC
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.
Comment 4 Pavel Flaska 2007-03-12 08:49:40 UTC
Reproducible testcase added.

Checking in test/unit/src/org/netbeans/api/java/source/gen/;
new revision: 1.2; previous revision: 1.1
Comment 5 Pavel Flaska 2007-03-12 09:18:14 UTC
Hopefully fixed. Please, verify.

Checking in src/org/netbeans/modules/java/source/save/;
new revision: 1.84; previous revision: 1.83
Comment 6 _ deva 2007-03-14 00:38:38 UTC
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.