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 253839 - [81cat] org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 1
Summary: [81cat] org.netbeans.editor.GuardedException: Attempt to remove from guarded ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-27 08:17 UTC by cezariusz
Modified: 2015-08-05 01:20 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 218780


Attachments
stacktrace (11.85 KB, text/plain)
2015-07-27 08:17 UTC, cezariusz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cezariusz 2015-07-27 08:17:57 UTC
This issue was reported manually by cezariusz.
It already has 1 duplicates 


Build: NetBeans IDE Dev (Build 201507240001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.51-b03, Java(TM) SE Runtime Environment, 1.8.0_51-b16
OS: Windows 8

User Comments:
cezariusz: Safe delete of main




Stacktrace: 
org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 1
Comment 1 cezariusz 2015-07-27 08:17:59 UTC
Created attachment 154931 [details]
stacktrace
Comment 2 cezariusz 2015-07-27 08:24:26 UTC
Steps to reproduce:
1. Create a Java project
2. New | JDialog form | Finish
3. Switch to "Source"
4. Locate main (public static void main method)
5. Invoke "Safely Delete" on it
6. Execute Refactor
7. Observe the exception

org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 1 478.
	at org.netbeans.editor.GuardedDocument.preRemoveCheck(GuardedDocument.java:296)
	at org.netbeans.editor.BaseDocument.handleRemove(BaseDocument.java:967)
	at org.netbeans.editor.BaseDocument$FilterBypassImpl.remove(BaseDocument.java:2578)
	at javax.swing.text.DocumentFilter.remove(DocumentFilter.java:79)
...
Comment 3 Ralph Ruijs 2015-07-30 09:02:09 UTC
The trailing comment of initcomponents is getting deleted with the main method. Problem with comment assignments? Reassigning to java.source.
Comment 4 Svata Dedic 2015-07-31 14:09:49 UTC
Should be fixed by jet-main#927d0a4e3ff1
Comment 5 Quality Engineering 2015-08-05 01:20:28 UTC
Integrated into 'main-silver', will be available in build *201508050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/927d0a4e3ff1
User: Svata Dedic <sdedic@netbeans.org>
Log: #253839: whitespace search terminates at guarded blocks boundaries