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.
This bug was originally marked as duplicate of bug 171275, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 7.0 Beta (Build 201011152355) VM: Java HotSpot(TM) 64-Bit Server VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04 OS: Linux User Comments: leopard2av: Discard source modifications on close Stacktrace: javax.swing.undo.CannotUndoException at org.netbeans.editor.BaseDocumentEvent.undo(BaseDocumentEvent.java:271) at org.netbeans.editor.GuardedDocumentEvent.undo(GuardedDocumentEvent.java:72) at javax.swing.undo.CompoundEdit.undo(CompoundEdit.java:46) at org.netbeans.editor.BaseDocument$AtomicCompoundEdit.undo(BaseDocument.java:2221) at org.netbeans.editor.BaseDocument.breakAtomicLock(BaseDocument.java:1872) at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:320)
Created attachment 103334 [details] stacktrace
Milo, can you please check this one?
leopard2av: Is there any way how to reproduce this e.g. a specific source file? Thanks.
*** Bug 193502 has been marked as a duplicate of this bug. ***
It looks it was fixed by http://netbeans.org/bugzilla/show_bug.cgi?id=183998.
*** Bug 197979 has been marked as a duplicate of this bug. ***
This is probably happing, because of race condition, which is really difficult to find without a concrete steps for reproduce. Please, reopen if you can find a way to reproduce this exception
Reproduced this unreliably. I found that it happens after Bug 204285 and before Bug 204407. Here are the steps I used. In a Maven Java project: 1) right-click a test package (com.demo.test) >New > Java Class 2) create class MyClass in this package 3) add the following method package com.demo.test; public class MyClass { public void doSomething() { } } 4) right-click the same package > New > Java Class 5) create class MyService in this package 6) add the following method: package com.demo.test; import java.io.File; public class MyService { public void go(File file) { } } 7) Add a field to MyClass, and partially reference it: package com.demo.test; public class MyClass { private MyService service; public void doSomething() { service.go } } 8) Drag MyClass to a different package (com.demo.otherpackage) 9) Exception thrown: http://statistics.netbeans.org/analytics/detail.do?id=182335 10) Press "Refactor" 11) Drag MyClass back to com.demo.test 12) Exception thrown again: http://statistics.netbeans.org/analytics/detail.do?id=182335 13) Invoke code completion in MyClass as follows: package com.demo.test; public class MyClass { private MyService service; public void doSomething() { service.go| } } 14) Press Command+Z (or Ctrl+Z) to undo. Exception will be thrown. 15) After pressing Command+Z and Command+Shift+Z for a while to replicate the issue, I got this exception: http://statistics.netbeans.org/exceptions/detail.do?id=182426
Reproduced with simpler scenario. Still in Maven project: 1) Create new class in test package com.demo.MyClass package com.demo; import java.io.File; public class MyClass { public static class MyOtherClass { public void go(File file) { } } private MyOtherClass other; public void doSomething() { other.go } } 2) Drag class to different test package (com.demo.other). Exception thrown. 3) Drag class back to original package (com.demo) 4) invoke code completion as shown below. Exception will be thrown. package com.demo; import java.io.File; public class MyClass { public static class MyOtherClass { public void go(File file) { } } private MyOtherClass other; public void doSomething() { other.go| } }
*** Bug 216683 has been marked as a duplicate of this bug. ***
*** Bug 204407 has been marked as a duplicate of this bug. ***
Created attachment 142138 [details] stacktrace Happened when following [1] when I tied to finish JavaScript REST Client wizard [1] http://jaxenter.com/from-database-to-restful-web-service-to-html5-in-10-minutes-46064.html
Created attachment 142534 [details] stacktrace ,
Created attachment 142536 [details] stacktrace <Please provide a description of the problem or the steps to reproduce>
31 reports => P2
(In reply to dbell from comment #9) > Reproduced with simpler scenario. Still in Maven project: This scenario does not fail for me (but it's that it no longer happens since it was entered on 2011-10-30). Does anyone have any scenario that I could use to reproduce? Specifically for this problem without a reproducible test case I'm unable to make any progress. Last few reports are caused by fold operation problems so I've entered issue #242363 for that problem.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss