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 62259 - BadLocationException thrown when closing Java Editor files
Summary: BadLocationException thrown when closing Java Editor files
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Adamek
URL:
Keywords:
: 66120 66318 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-15 02:54 UTC by wjbug
Modified: 2006-08-16 10:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
my NB messages.log at time of exception (99.28 KB, text/plain)
2005-08-15 02:56 UTC, wjbug
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wjbug 2005-08-15 02:54:07 UTC
Hi NB Developers,

I've been noticing just in last download I got of v4.2dev (20050811),
immediately after I close a *.java file window from the Editor, I get the
following Exception:

javax.swing.text.BadLocationException: Invalid offset=1465 not within <0, 1>
	at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1227)
	at org.netbeans.editor.Utilities.getLineOffset(Utilities.java:552)
	at
org.netbeans.modules.java.hints.JavaHintsProvider.getHints(JavaHintsProvider.java:74)
	at
org.netbeans.modules.editor.hints.HintsOperator$HintPopupTaskImpl.run(HintsOperator.java:221)
	at org.openide.util.Task.run(Task.java:207)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:469)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:870)

The error appears to be caused by code trying to track an offset position within
the editor window but has missed the fact that window is now null - maybe?

I'm running on the following operating platform:
uname -a
Darwin BB-PBook.local 8.2.0 Darwin Kernel Version 8.2.0: Fri Jun 24 17:46:54 PDT
2005; root:xnu-792.2.4.obj~3/RELEASE_PPC Power Macintosh powerpc

java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-219)
Java HotSpot(TM) Client VM (build 1.4.2-53, mixed mode)

Like I mentioned, I'm running NB v4.2 - daily bld 20050811.  I have a lot of
modules installed.  I'll attach my message.log so you can see what's loading at
launch time.

Cheers,
Bill Bug
Comment 1 wjbug 2005-08-15 02:56:54 UTC
Created attachment 23774 [details]
my NB messages.log at time of exception
Comment 2 Martin Roskanin 2005-08-15 09:20:46 UTC
Reassigning to java module. Please, check BadLocationException in
JavaHintsProvider.getHints... similar issue: issue #56315
Comment 3 Lukas Hasik 2005-08-24 16:30:43 UTC
happend to me on XP too.
It's annoying I'd mark it as P2 - it's really really visible, I just closed
documents. 
Comment 4 Tomas Hurka 2005-09-19 12:38:04 UTC
Fixed in trunk.
Checking in src/org/netbeans/modules/java/hints/JavaHintsProvider.java;
/cvs/java/hints/src/org/netbeans/modules/java/hints/JavaHintsProvider.java,v  <--  
JavaHintsProvider.java
new revision: 1.47; previous revision: 1.46
done

Similar patch should be applied to org.netbeans.modules.j2ee.ejbcore.hints.EjbHintsProvider.getHints()

Reassigning to j2ee.
Comment 5 Martin Adamek 2005-10-03 15:30:50 UTC
Fixed already.
Comment 6 Tomas Hurka 2005-10-07 10:44:36 UTC
*** Issue 66120 has been marked as a duplicate of this issue. ***
Comment 7 Jan Chalupa 2005-10-09 17:08:45 UTC
*** Issue 66318 has been marked as a duplicate of this issue. ***
Comment 8 Jan Becicka 2005-10-11 13:10:50 UTC
*** Issue 66428 has been marked as a duplicate of this issue. ***
Comment 9 Jan Horvath 2006-08-16 10:54:00 UTC
v