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 81674 - HintsProvider.getHints() is invoked with invalid offset
Summary: HintsProvider.getHints() is invoked with invalid offset
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: RANDOM
: 81740 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-02 09:56 UTC by Tomasz Slota
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Slota 2006-08-02 09:56:13 UTC
See  issue 80667 for details, I am pasting description for convenience:
---
I created a jaxrpc web service inside a web app.  When the java source for the
service appeared, I deleted the comment block (apparently while the hint
processor was running).

I received this exception:

javax.swing.text.BadLocationException: Invalid offset=290 not within <0, 200>
	at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1268)
	at org.netbeans.editor.Utilities.getLineOffset(Utilities.java:593)
	at
org.netbeans.modules.j2ee.verification.JEEVerificationHintsProvider.getHints
(JEEVerificationHintsProvider.java:73)
	at
org.netbeans.modules.editor.hints.HintsOperator$HintPopupTaskImpl.run(HintsOperator.java:260)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)

Seems like there is a synchronization problem in that the hints processor is
working with the text and data retrieved before I performed my delete operation
and attempting to use that data after it has been rendered invalid.

----

JEEVerificationHintsProvider.getHints() basically calls getLineOffset() for the offset and document it 
receives, so the problems seems to be located in the editor infrastructure
Comment 1 Jiri Prox 2006-08-03 10:54:45 UTC
*** Issue 81740 has been marked as a duplicate of this issue. ***
Comment 2 Miloslav Metelka 2006-08-07 15:35:34 UTC
Please consume the BLE as a workaround.
We are investigating what would be the most appropriate solution to this
(regarding threading etc.) Thanks.
Comment 3 Jan Lahoda 2006-11-30 19:22:52 UTC
The editor/hints framework has been rewritten, so this problem should not occur
anymore.