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 113378 - GuardedException Create Method from Hints
Summary: GuardedException Create Method from Hints
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P4 blocker (vote)
Assignee: Max Sauer
URL:
Keywords:
: 158573 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-21 16:19 UTC by Fabiola Rios
Modified: 2009-11-02 11:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ZIP project (95.62 KB, application/x-compressed)
2007-08-21 16:37 UTC, Fabiola Rios
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabiola Rios 2007-08-21 16:19:46 UTC
build 20070821

Open Mobile project from 5.5 version with some code added manually, convert the old Visual MIDlet.
Open the Converted file, Try to add some method from the Hints, and the follow GuardedException appears.

org.netbeans.editor.GuardedException: Attempt to insert into guarded block at position 19,209.
	at org.netbeans.editor.GuardedDocument.preInsertCheck(GuardedDocument.java:156)
	at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:554)
	at org.netbeans.api.java.source.ModificationResult.commit(ModificationResult.java:94)
Caused: java.io.IOException
	at org.netbeans.api.java.source.ModificationResult.commit(ModificationResult.java:105)
	at org.netbeans.api.java.source.ModificationResult.commit(ModificationResult.java:67)
	at org.netbeans.modules.java.hints.errors.Utilities.commitAndComputeChangeInfo(Utilities.java:216)
	at org.netbeans.modules.java.hints.errors.CreateMethodFix.implement(CreateMethodFix.java:177)
	at org.netbeans.modules.editor.hints.HintsUI$1.run(HintsUI.java:545)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
Comment 1 Fabiola Rios 2007-08-21 16:37:55 UTC
Created attachment 46986 [details]
ZIP project
Comment 2 Jan Lahoda 2007-10-09 15:25:25 UTC
Low use-case, IMO, will not be so visible in production builds (exceptions are disabled there) and quite hard to fix.
Comment 3 benatidc 2007-10-10 22:01:06 UTC
I have run into this problem several times. I believe that the add method function tries to add methods in alphabetical
order, and if it attempts to add a method between two guarded methods, it hits a guarded block. Maybe it can be easily
fixed by either adding methods to the bottom of a class, similar to the encapsulate fields function, or making sure it
doesn't hit a guarded block when adding space between 2 guarded methods.
Comment 4 Vitezslav Stejskal 2009-02-16 10:52:05 UTC
*** Issue 158573 has been marked as a duplicate of this issue. ***
Comment 5 David Strupl 2009-03-31 16:04:02 UTC
Resolving all issues with milestone "future" as LATER. If you feel strongly that
it should be implemented please reopen and set the target milestone to "next".
Comment 6 Quality Engineering 2009-11-02 11:00:33 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX