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 204965 - [71cat] StackOverflowError at javax.swing.undo.CompoundEdit.lastEdit
Summary: [71cat] StackOverflowError at javax.swing.undo.CompoundEdit.lastEdit
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 7.1
Hardware: All All
: P1 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks: 21237
  Show dependency tree
 
Reported: 2011-11-10 23:25 UTC by alied
Modified: 2011-11-24 15:08 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 182799


Attachments
stacktrace (67.03 KB, text/plain)
2011-11-10 23:25 UTC, alied
Details
Java source file to reproduce bug. (765 bytes, text/plain)
2011-11-14 07:11 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alied 2011-11-10 23:25:46 UTC
Build: NetBeans IDE Dev (Build 201111090600)
VM: Java HotSpot(TM) Client VM, 21.1-b02, Java(TM) SE Runtime Environment, 1.7.0_01-b08
OS: Windows XP

User Comments:
alied: Now every time I change the code i get this exception.
restarting NetBeans.

alied: I invoked Code Completion.




Stacktrace: 
java.lang.StackOverflowError
   at javax.swing.undo.CompoundEdit.lastEdit(CompoundEdit.java:88)
   at javax.swing.undo.CompoundEdit.addEdit(CompoundEdit.java:128)
   at javax.swing.undo.CompoundEdit.addEdit(CompoundEdit.java:138)
   at javax.swing.undo.CompoundEdit.addEdit(CompoundEdit.java:138)
   at javax.swing.undo.CompoundEdit.addEdit(CompoundEdit.java:138)
   at javax.swing.undo.CompoundEdit.addEdit(CompoundEdit.java:138)
Comment 1 alied 2011-11-10 23:25:50 UTC
Created attachment 113102 [details]
stacktrace
Comment 2 MackSix 2011-11-14 07:11:09 UTC
Created attachment 113172 [details]
Java source file to reproduce bug.

1) Open attached java file in NetBeans.
2) Put cursor on method2() call inside method1().
3) Right click and choose Refactor>>Inline... and then on preview window, click "Do Refactoring" button.
4) Right click on anywhere on code in editor and choose Refactor>>Undo[Inline Method].
5) Now type this in at bottom of class:

public void setX(int x) {
    this.x = x;
}

This exception is thrown when this.x is typed.

This causes the exception to be thrown over and over and NetBeans must be closed. It nearly locks up NetBeans because it takes 10 - 12 seconds before it will close.
Comment 3 MackSix 2011-11-14 07:26:36 UTC
Make sure you delete public void setX(int x) from the file before you go through the steps. If you just try to type this.x inside the method already in the file, it won't throw the exception. You have to type the whole method in new.
Comment 4 Miloslav Metelka 2011-11-14 09:40:40 UTC
Reproduced. It's probably related to implementing of #21237.
Comment 5 Miloslav Metelka 2011-11-14 15:25:17 UTC
http://hg.netbeans.org/jet-main/rev/aa155afd5926
Comment 6 Quality Engineering 2011-11-15 15:42:39 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/aa155afd5926
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #204965 - StackOverflowError at javax.swing.undo.CompoundEdit.lastEdit().
Comment 7 Jiri Prox 2011-11-24 15:08:40 UTC
verified