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 157281 - java.io.IOException at org.netbeans.api.java.source.ModificationResult.processDocument
Summary: java.io.IOException at org.netbeans.api.java.source.ModificationResult.proces...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Max Sauer
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-21 22:40 UTC by Jesse Glick
Modified: 2009-09-04 14:35 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 144506


Attachments
stacktrace (7.06 KB, text/plain)
2009-01-21 22:40 UTC, Jesse Glick
Details
stacktrace (4.22 KB, text/plain)
2009-02-24 20:47 UTC, senneko
Details
stacktrace (4.14 KB, text/plain)
2009-06-17 21:06 UTC, cbulcu
Details
stacktrace (4.14 KB, text/plain)
2009-06-17 23:35 UTC, cbulcu
Details
stacktrace (4.14 KB, text/plain)
2009-08-31 12:26 UTC, cbulcu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-01-21 22:40:06 UTC
Build: NetBeans IDE Dev (Build 090120)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Linux, 2.6.27-9-generic, i386

User Comments:
jglick: Tried to use code completion to implement a required method (ChangeListener.stateChanged) in a form file.
Was not inside a guarded area at the time, but a few lines down from one.

jglick: Tried to use code completion to implement a required method (ChangeListener.stateChanged) in a form file.
Was not inside a guarded area at the time, but a few lines down from one.



Stacktrace: 
java.io.IOException
        at org.netbeans.api.java.source.ModificationResult.processDocument(ModificationResult.java:356)
        at org.netbeans.api.java.source.ModificationResult.commit2(ModificationResult.java:325)
        at org.netbeans.api.java.source.ModificationResult.access$000(ModificationResult.java:83)
        at org.netbeans.api.java.source.ModificationResult$2.run(ModificationResult.java:230)
        at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:324)
        at org.openide.text.NbDocument.runAtomic(NbDocument.java:384)
Comment 1 Jesse Glick 2009-01-21 22:40:12 UTC
Created attachment 76120 [details]
stacktrace
Comment 2 Max Sauer 2009-02-09 15:12:17 UTC
I've tried to reproduce w/o success, is there any reliable usecase? Thanks.
Comment 3 Jesse Glick 2009-02-10 23:18:23 UTC
No, just happened to me that one time.
Comment 4 Exceptions Reporter 2009-02-24 20:33:10 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=144506
Comment 5 senneko 2009-02-24 20:47:08 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Windows XP, 5.1, x86

User Comments: 


Stacktrace: 
java.io.IOException
        at org.netbeans.api.java.source.ModificationResult.processDocument(ModificationResult.java:278)
        at org.netbeans.api.java.source.ModificationResult.commit2(ModificationResult.java:247)
        at org.netbeans.api.java.source.ModificationResult.access$000(ModificationResult.java:69)
        at org.netbeans.api.java.source.ModificationResult$1.run(ModificationResult.java:152)
        at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:294)
        at org.openide.text.NbDocument.runAtomic(NbDocument.java:384)
Comment 6 senneko 2009-02-24 20:47:12 UTC
Created attachment 77318 [details]
stacktrace
Comment 7 locked 2009-03-30 16:03:39 UTC
As I wrote in Report 182883.
marked a complete method body (of a ui generated actionperformed method) and used
refactor > introduse method, entered a methodname and hit enter 
the method body was like "if (){ IFBODY }".

Even when selecting the IFBODY alone (in order to avoid selecting any caharacter that belonged to the guarded lines),
the IOException occured.
Comment 8 cbulcu 2009-06-17 21:05:53 UTC
Build: NetBeans IDE 6.7 RC3 (Build 200906142201)
VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Windows XP, 5.1, x86

User Comments: 
wanted to introduce a method from an existent event handler. The code I selected was NOT guarded, because I was carefull to select only my code

Stacktrace: 
org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 17.762.
        at org.netbeans.editor.GuardedDocument.preRemoveCheck(GuardedDocument.java:287)
        at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:891)
        at org.netbeans.api.java.source.ModificationResult.processDocumentLocked(ModificationResult.java:375)
        at org.netbeans.api.java.source.ModificationResult.access$100(ModificationResult.java:85)
        at org.netbeans.api.java.source.ModificationResult$3.run(ModificationResult.java:344)
        at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:354)
Comment 9 cbulcu 2009-06-17 21:06:03 UTC
Created attachment 83725 [details]
stacktrace
Comment 10 cbulcu 2009-06-17 23:35:52 UTC
Build: NetBeans IDE 6.7 RC3 (Build 200906142201)
VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Windows XP, 5.1, x86

User Comments: 
I was trying to introduce a new method using some code in another method. I wasn't in a guarded method's body.

Stacktrace: 
org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 17.942.
        at org.netbeans.editor.GuardedDocument.preRemoveCheck(GuardedDocument.java:287)
        at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:891)
        at org.netbeans.api.java.source.ModificationResult.processDocumentLocked(ModificationResult.java:375)
        at org.netbeans.api.java.source.ModificationResult.access$100(ModificationResult.java:85)
        at org.netbeans.api.java.source.ModificationResult$3.run(ModificationResult.java:344)
        at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:354)
Comment 11 cbulcu 2009-06-17 23:35:57 UTC
Created attachment 83728 [details]
stacktrace
Comment 12 cbulcu 2009-08-31 12:26:29 UTC
Build: NetBeans IDE 6.7.1 (Build 200907230233)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows Vista, 6.0, x86

User Comments: 
tried to "Introduce method"

Stacktrace: 
org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 9.843.
        at org.netbeans.editor.GuardedDocument.preRemoveCheck(GuardedDocument.java:287)
        at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:891)
        at org.netbeans.api.java.source.ModificationResult.processDocumentLocked(ModificationResult.java:375)
        at org.netbeans.api.java.source.ModificationResult.access$100(ModificationResult.java:85)
        at org.netbeans.api.java.source.ModificationResult$3.run(ModificationResult.java:344)
        at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:354)
Comment 13 cbulcu 2009-08-31 12:26:34 UTC
Created attachment 86843 [details]
stacktrace
Comment 14 Exceptions Reporter 2009-08-31 12:26:40 UTC
This issue already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=144506
Comment 15 Max Sauer 2009-09-04 14:35:31 UTC
This should be fixed by 

http://hg.netbeans.org/main-golden/rev/a1000ec9db36 (included in 200908210201 build)

Please reopen if it occurs again.