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 107402

Summary: REF: redo in refactoring of local variables doesn't work
Product: editor Reporter: Jana Maleckova <janie>
Component: -- Other --Assignee: Jan Lahoda <jlahoda>
Status: VERIFIED FIXED    
Severity: blocker CC: jlahoda, tpavek
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 106361    
Attachments: 107402
Thread dump

Description Jana Maleckova 2007-06-20 11:38:40 UTC
Product Version: NetBeans IDE Dev (Build 200706200326) 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) Userdir: D:\userdir60

Description:
============
do refactoring - rename on some local variable in form template (placed in guarded block)
do refactoring UNDO
do refactoring REDO
Redo is not performed and if it is invoke for the first time then an exception is thrown

StackTrace:
===========
java.lang.NullPointerException
	at org.netbeans.modules.form.FormRefactoringUpdate.renameMetaComponent(FormRefactoringUpdate.java:251)
	at org.netbeans.modules.form.FormRefactoringUpdate.commit(FormRefactoringUpdate.java:150)
	at org.netbeans.modules.refactoring.api.RefactoringSession.doRefactoring(RefactoringSession.java:91)
	at org.netbeans.modules.refactoring.spi.impl.UndoManager$SessionUndoItem.redo(UndoManager.java:512)
Comment 1 Jana Maleckova 2007-06-20 11:39:26 UTC
Created attachment 44041 [details]
107402
Comment 2 Tomas Pavek 2007-06-22 16:33:26 UTC
Fixed.

/cvs/form/src/org/netbeans/modules/form/FormRefactoringUpdate.java
new revision: 1.4; previous revision: 1.3
Comment 3 Jana Maleckova 2007-06-25 11:53:34 UTC
tested on 
Product Version: NetBeans IDE 6.0 Milestone 10 (build 200706242201) 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:
============
open JDA (Java Desktop Application) project.
1. insert some component in generated form - view
2. switch to editor and do refactoring - rename local variable of this component
3. do refactoring - undo
4. do refactoring - redo

Then IDE gets stuck
Thread dump is in attachment
Comment 4 Jana Maleckova 2007-06-25 11:56:41 UTC
Created attachment 44332 [details]
Thread dump
Comment 5 Miloslav Metelka 2007-06-25 15:57:49 UTC
AnnotationHolder monitor <-> Document-lock.
Honza L. will fix it.
Comment 6 Jan Lahoda 2007-06-25 16:50:04 UTC
*** Issue 107232 has been marked as a duplicate of this issue. ***
Comment 7 Jan Lahoda 2007-06-25 16:55:16 UTC
Should be fixed now. Please verify on trunk, so I can merge it into the M10 branch. Thanks.

Checking in AnnotationHolder.java;
/cvs/editor/hints/src/org/netbeans/modules/editor/hints/AnnotationHolder.java,v  <--  AnnotationHolder.java
new revision: 1.13; previous revision: 1.12
done
Comment 8 Peter Pis 2007-06-26 09:32:04 UTC
Could you please verify this issue for M10? Thanks.
Comment 9 Jana Maleckova 2007-06-26 09:39:06 UTC
now, ide doesn't get stuck, undo/redo works in form class
there is another issue with find usages described in issue http://www.netbeans.org/issues/show_bug.cgi?id=108112

but it is no longer M10 stopper
verified on 
Product Version: NetBeans IDE Dev (Build 200706260205) 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)
Comment 10 Peter Pis 2007-06-26 09:57:49 UTC
Please provide the fix for "release60-m10" branch.
Comment 11 Jan Lahoda 2007-06-26 10:44:48 UTC
The fix is merged into the M10 branch:
Checking in src/org/netbeans/modules/editor/hints/AnnotationHolder.java;
/cvs/editor/hints/src/org/netbeans/modules/editor/hints/AnnotationHolder.java,v  <--  AnnotationHolder.java
new revision: 1.12.4.1; previous revision: 1.12
done

Please verify again on the branch. Thanks.
Comment 12 Jana Maleckova 2007-06-27 08:38:24 UTC
verified on M10

Product Version: NetBeans IDE 6.0M10 (build 200706270116) Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b03
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)