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 205457 - [71cat] org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 4.021.
Summary: [71cat] org.netbeans.editor.GuardedException: Attempt to remove from guarded ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 203190 206807 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-23 07:57 UTC by stefan79
Modified: 2013-07-12 02:30 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 183112


Attachments
stacktrace (4.57 KB, text/plain)
2011-11-23 07:57 UTC, stefan79
Details
stacktrace (4.87 KB, text/plain)
2012-04-01 20:59 UTC, sunbiz
Details
stacktrace (4.96 KB, text/plain)
2012-04-13 19:38 UTC, Exceptions Reporter
Details
stacktrace (4.37 KB, text/plain)
2012-05-09 08:47 UTC, MackSix
Details
stacktrace (4.95 KB, text/plain)
2012-05-16 07:21 UTC, stefan79
Details
stacktrace (5.58 KB, text/plain)
2012-11-06 15:47 UTC, Jiri Prox
Details
stacktrace (4.10 KB, text/plain)
2012-11-09 16:58 UTC, Jiri Prox
Details
stacktrace (8.49 KB, text/plain)
2013-04-23 14:34 UTC, Jiri Skrivanek
Details
stacktrace (8.42 KB, text/plain)
2013-04-23 15:58 UTC, Stepan Zebra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stefan79 2011-11-23 07:57:43 UTC
Build: NetBeans IDE 7.1 RC1 (Build 201111171527)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.0-b11, Java(TM) SE Runtime Environment, 1.6.0_25-b06
OS: Windows 7

User Comments:
stefan79: Tried to Refactore -> Introduce Constant.
One occurence was between the guarded-Section (in a JPanel).




Stacktrace: 
org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position 4.021.
   at org.netbeans.editor.GuardedDocument.preRemoveCheck(GuardedDocument.java:291)
   at org.netbeans.editor.BaseDocument.handleRemove(BaseDocument.java:925)
   at org.netbeans.editor.BaseDocument$FilterBypassImpl.remove(BaseDocument.java:2343)
   at javax.swing.text.DocumentFilter.remove(DocumentFilter.java:51)
   at org.openide.text.CloneableEditorSupport$DocFilter.remove(CloneableEditorSupport.java:2997)
   at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:889)
Comment 1 stefan79 2011-11-23 07:57:46 UTC
Created attachment 113445 [details]
stacktrace
Comment 2 Milutin Kristofic 2011-11-24 11:55:56 UTC
Propably org.netbeans.api.java.source.ModificationResult.processDocument.
Comment 3 sunbiz 2012-04-01 20:59:22 UTC
Created attachment 117614 [details]
stacktrace

Convert Anonymous to Member inside a gaurded code block
Comment 4 Exceptions Reporter 2012-04-01 20:59:41 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=183112
Comment 5 Exceptions Reporter 2012-04-13 19:38:27 UTC
Created attachment 118258 [details]
stacktrace
Comment 6 MackSix 2012-05-09 08:47:53 UTC
Created attachment 119191 [details]
stacktrace

Try to move guarded event handler location with "Additional Java Navigator Panels" Plugin.
Comment 7 stefan79 2012-05-16 07:21:03 UTC
Created attachment 119501 [details]
stacktrace

Tried: Introduce Constant (same reference was used in Guarded Section; as setName("xx")).
Comment 8 Exceptions Reporter 2012-07-22 20:08:11 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=183112
Comment 9 Marian Mirilovic 2012-10-19 12:23:18 UTC
*** Bug 206807 has been marked as a duplicate of this bug. ***
Comment 10 Marian Mirilovic 2012-10-19 12:25:06 UTC
*** Bug 203190 has been marked as a duplicate of this bug. ***
Comment 11 Jiri Prox 2012-11-06 15:47:11 UTC
Created attachment 127234 [details]
stacktrace

Exception occured when generation bean info from the simple class
Comment 12 Jiri Prox 2012-11-09 16:58:50 UTC
Created attachment 127499 [details]
stacktrace

GE when reformatting form file
Steps to reproduce:
1) create new form file
2) change formatting settings (e.g. set indentation to 3)
3) enable reformat on save
4) modify the file and save it
Comment 13 Jiri Skrivanek 2013-04-23 14:34:16 UTC
Created attachment 133716 [details]
stacktrace

When JFrame Form created by wizard was about to open.
Comment 14 Stepan Zebra 2013-04-23 15:58:16 UTC
Created attachment 133719 [details]
stacktrace

generating a new JFrame form
Comment 15 Exceptions Reporter 2013-05-18 06:07:59 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=183112
Comment 16 Jan Lahoda 2013-07-01 14:43:51 UTC
The recent reports appear to be bound to formatting. The easiest way to reproduce I have found is:
-change the formatting settings as follows:
--spaces-per-tab=3 (for all languages)
--wrapAnnotations=NEVER (for java)
-create a new JPanel form.

The cause appears to be that the reformater attempts to alter the whitespace that starts with the last newline before the first guarded block and spans through the indent inside the guarded block.
Comment 17 Dusan Balek 2013-07-09 13:33:29 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/27770f559be1
Comment 18 Quality Engineering 2013-07-12 02:30:27 UTC
Integrated into 'main-silver', will be available in build *201307112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/27770f559be1
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #205457: org.netbeans.editor.GuardedException: Attempt to remove from guarded block at position - fixed.