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.
Summary: | RuntimeException at org.netbeans.modules.refactoring.java.plugins.RetoucheCommit.rollback | ||
---|---|---|---|
Product: | guibuilder | Reporter: | Jiri Prox <jiriprox> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | NEW --- | ||
Severity: | blocker | CC: | aldobrucale, asenk, ca-nb, dbcurtis, devon_c_miller, diefer, ggghhhjjj, javydreamercsw, jbecicka, joshis, jpokorsky, sunbiz, ttokoly |
Priority: | P3 | ||
Version: | 7.0 | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=125648 | ||
Issue Type: | DEFECT | Exception Reporter: | 125648 |
Attachments: |
stacktrace
stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace |
Description
Jiri Prox
2008-10-09 16:39:58 UTC
Created attachment 71477 [details]
stacktrace
Could you attach a test class for verifying purposes? Build: NetBeans IDE Dev (Build 200810240201) VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc2-b32 OS: Windows Vista, 6.0, x86 User Comments: Refactor-> Undo Rename on a method inside gaurded block Stacktrace: java.lang.RuntimeException at org.netbeans.modules.refactoring.java.plugins.RetoucheCommit.rollback(RetoucheCommit.java:100) at org.netbeans.modules.refactoring.api.RefactoringSession.undoRefactoring(RefactoringSession.java:163) at org.netbeans.modules.refactoring.spi.impl.UndoManager$SessionUndoItem.undo(UndoManager.java:596) at org.netbeans.modules.refactoring.spi.impl.UndoManager.undo(UndoManager.java:221) at org.netbeans.modules.refactoring.spi.impl.UndoAction.performAction(UndoAction.java:96) at org.openide.util.actions.CallableSystemAction$.run(CallableSystemAction.java:118) Created attachment 72756 [details]
stacktrace
Build: NetBeans IDE Dev (Build 200905100201) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b02 OS: Windows XP, 5.1, x86 User Comments: To reproduce: - create Mobile Application with Hello MIDlet; - in Flow, select form and invoke Rename popup menu command; - set a new name, perform refactoring; - in Projects tree, select HelloMIDlet.java and invoke 'Refactor|Undo'. Stacktrace: org.openide.util.RequestProcessor$Item: task failed: java.lang.RuntimeException at org.openide.util.RequestProcessor$Item.fillInStackTrace(RequestProcessor.java:853) at java.lang.Throwable.<init>(Throwable.java:181) at java.lang.Exception.<init>(Exception.java:29) at org.openide.util.RequestProcessor$Item.<init>(RequestProcessor.java:819) at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:629) at org.openide.util.RequestProcessor.post(RequestProcessor.java:295) Created attachment 82137 [details]
stacktrace
Build: NetBeans IDE Dev (Build 200908171401) VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08 OS: Linux, 2.6.28-11-generic, i386 User Comments: I have created a class extending a JPanel. Then I added a JList in a designer "jList1". I switched to editor and wrote some code that use this variable name. Then I invoked Ctrl+R above this variable to rename it. I renamed the variable, but it was not successful (guarded code was not updated), so I invoked Refactor>Undo Stacktrace: java.lang.Throwable: Locked by: at org.openide.filesystems.FileLock.<init>(FileLock.java:80) at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.<init>(LockForFile.java:89) at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(LockForFile.java:100) at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:313) at org.openide.loaders.MultiDataObject$Entry.takeLock(MultiDataObject.java:1189) at org.netbeans.modules.form.FormEditorSupport$Environment.takeLock(FormEditorSupport.java:1369) Created attachment 86479 [details]
stacktrace
This issue already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=125648 Thank you for the reproducible test case with form file. I will investigate. It seems to be a problem in the form editor support that does not release the file lock. If you choose the Save Document action manually then changes propagate as expected. In case of plain java file the rename works. Reassigning. Build: NetBeans IDE Dev (Build nbms-and-javadoc-3940-on-090917) VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01 OS: Linux, 2.6.28-15-generic, i386 User Comments: undo rename Stacktrace: java.lang.Throwable: Locked by: at org.openide.filesystems.FileLock.<init>(FileLock.java:80) at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.<init>(LockForFile.java:89) at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(LockForFile.java:100) at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:313) at org.openide.loaders.MultiDataObject$Entry.takeLock(MultiDataObject.java:1189) at org.netbeans.modules.form.FormEditorSupport$Environment.takeLock(FormEditorSupport.java:1370) Created attachment 87862 [details]
stacktrace
This issue already has 6 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=125648 Created attachment 92120 [details]
stacktrace
Rename de uma classe
Created attachment 93586 [details]
stacktrace
I tried to rename field, which declaration is in guarded block. There is no warning, that I cannot do that and refactoring is done only in non-guarded sections (breaking the code). Both Undo (editor and refactoring) did not work for me.
Created attachment 107832 [details]
stacktrace
1. Create new project: main menu File | New Project... | Java, Java Application | Next (leave all default) | Finish
2. Create new JFrame in main package (by default javaapplication1): invoke popup menu on package node in Projects view | New | JFrame Form... (leave all by default) | Finish
3. NewJFrame.java should be created and Design button pushed (main menu View | Editors | Design). From Palette window | Swing Controls grab Button and drop it somwhere inside the NewJFrame.
4. Push the Source button (main menu View | Editors | Source)
5. Copy and paste this code:
public void foo(){
JButton jButton1= new JButton();
JButton jButton2= jButton1;
}
public void foo2(){
String neco=this.jButton1.getText();
}
somewhere to NewJFrame class (e.g. below constructor).
6. Invoke Refactor | Rename from popup menu on jButton1 in method foo2.
7. Enter new name (e.g. tlacitkooo). Preview the changes and perform Refactor.
8. Call main menu Refactor | Undo.
Created attachment 107833 [details]
stacktrace
Product Version: NetBeans IDE Dev (Build 201104180401)
Java: 1.6.0_25; Java HotSpot(TM) Client VM 20.0-b11
System: Linux version 2.6.32-30-generic running on i386; UTF-8; en_US (nb)
1. Create new project: main menu File | New Project... | Java, Java Application | Next (leave all default) | Finish
2. Create new JFrame in main package (by default javaapplication1): invoke popup menu on package node in Projects view | New | JFrame Form... (leave all by default) | Finish
3. NewJFrame.java should be created and Design button pushed (main menu View | Editors | Design). From Palette window | Swing Controls grab Button and drop it somwhere inside the NewJFrame.
4. Push the Source button (main menu View | Editors | Source)
5. Copy and paste this code:
public void foo(){
JButton jButton1= new JButton();
JButton jButton2= jButton1;
}
public void foo2(){
String neco=this.jButton1.getText();
}
somewhere to NewJFrame class (e.g. below constructor).
6.
Created attachment 108082 [details]
stacktrace
Tried undo Encapsulate Fields.
Updated to 7.0 as it was reproduced on that release. There is no special refactoring undo action since 7.2, it's done by the Edit | Undo action. The problem is that the GUI builder resets the editor undo queue when generating code - which it does during refactoring. So undo of refactoring is currently not possible when a GUI form is involved. |