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 105649

Summary: Rename of local variables doesn't work inside of method with guarded blocks
Product: editor Reporter: Jana Maleckova <janie>
Component: RefactoringAssignee: Jan Pokorsky <jpokorsky>
Status: VERIFIED FIXED    
Severity: blocker CC: belkorin
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: image documenting problem

Description Jana Maleckova 2007-06-04 22:03:32 UTC
Product Version: NetBeans IDE Dev (Build 200706031800) 
Java: 1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02 
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)

Description:
=============
Have project with form class. Form class contains component and this component
has defined handler for action performed (this method is bounded by guarded blocks)
1. define your local variable (is not in guarded block)
2. use it in handler
3. try to rename this variable
See, variable is not renamed in action method
Comment 1 Tomas Pavek 2007-06-08 11:00:54 UTC
This is inside event handler where only the method boundaries are guarded, but
the code inside the method is not protected. This should be handled by java
refactoring.
Comment 2 Jan Becicka 2007-06-08 13:36:57 UTC
Reassigning to guarded block master.
Detection of guarded block fails in this case.
Comment 3 Jana Maleckova 2007-06-20 12:57:51 UTC
*** Issue 107414 has been marked as a duplicate of this issue. ***
Comment 4 Tomas Pavek 2007-06-26 10:03:17 UTC
*** Issue 108063 has been marked as a duplicate of this issue. ***
Comment 5 belkorin 2007-06-28 21:28:52 UTC
the "find usages" function also thinks that inside of a method bounded by guarded blocks is a read-only block, as shown
in the attachment.

Product Version: NetBeans IDE Dev (Build 200706270000) 
Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 6 belkorin 2007-06-28 21:29:36 UTC
Created attachment 44552 [details]
image documenting problem
Comment 7 Max Sauer 2007-07-17 10:55:54 UTC
This error can be easily reproduced also when using 'Change method parameters' for a method defined inside form file,
and having this method called inside of a 'guarded' method.
---
Product Version: NetBeans IDE Dev (Build 070717) 
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 
System: Linux version 2.6.12-1.1390_FC4smp running on i386; 
UTF-8; en_US (nb) Userdir: /home/ms159439/.netbeans/dev
Comment 8 Jan Pokorsky 2007-07-25 14:56:12 UTC
fixed in

/cvs/refactoring/api/src/org/netbeans/modules/refactoring/spi/RefactoringElementsBag.java
new revision: 1.17; previous revision: 1.16
Comment 9 Jiri Prox 2007-08-02 12:57:53 UTC
v.
Comment 10 Tomas Pavek 2007-08-27 09:19:21 UTC
*** Issue 113162 has been marked as a duplicate of this issue. ***