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 96749 - NPE during Ctrl-F3
Summary: NPE during Ctrl-F3
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-02-28 10:02 UTC by Martin Krauskopf
Modified: 2007-11-05 13:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE (3.45 KB, text/plain)
2007-02-28 10:02 UTC, Martin Krauskopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2007-02-28 10:02:10 UTC
Attaching. Start happening to me after bigger refactoring of my project with
broken sources. After IDE restart it start to work. I do not have any particular
steps to reproduce.
Comment 1 Martin Krauskopf 2007-02-28 10:02:38 UTC
Created attachment 38965 [details]
NPE
Comment 2 Miloslav Metelka 2007-02-28 11:36:02 UTC
Was it happening consistently after each redraw of screen in a particular source
or was it just thrown each time when pressing Ctrl+F3?
Comment 3 Martin Krauskopf 2007-02-28 11:52:36 UTC
I think that in all source files when pressed Ctrl-F3. But it did not happened
to me since the restart.
Comment 4 Martin Krauskopf 2007-02-28 11:57:51 UTC
It started to happen again. Always when I move cursor to some *unselected* word,
like this:

  public static fi|nal String...

and press Ctrl-F3 no the final the NPE is thrown. Pressing it again it works
until I choose another *unselected* word.
Comment 5 Martin Krauskopf 2007-02-28 12:48:09 UTC
It's happening quite often (P2). I've put debugging info into the culprit
method. Is is due to "component.getUI().getEditorKit(component) == null" in
TextSearchHighlighting.getMimeType()
Comment 6 Vitezslav Stejskal 2007-03-01 02:37:22 UTC
I can't reporoduce it, but the change below should make the mime type detection
more robust. AFAIK "component.getUI().getEditorKit(component) == null" can only
happen after the UI is unistalled from the component, which would suggest that
the NPE was thrown from a stale layer that should have already been GCed, but
for some reason was not. There is no explicit call that would tell a layer that
its job's done and it can safely unregister listeners, etc and quietly wait for
GC to kill it, so it's hard to tell what happened - memory leak, lazy GC, ...

When you said that it was happening quite often, did you find any way how to
reproduce it? At least with certain probability ...

Checking in TextSearchHighlighting.java;
/cvs/editor/lib2/src/org/netbeans/modules/editor/lib2/highlighting/TextSearchHighlighting.java,v
 <--  TextSearchHighlighting.java
new revision: 1.3; previous revision: 1.2
done
Comment 7 Martin Krauskopf 2007-03-01 05:14:43 UTC
> When you said that it was happening quite often, did you find any way how to
> reproduce it? At least with certain probability ...

I didn't. It just started happening after some time working in the IDE. I'll
update and try to watch closely the cause if something similar happens again.
Actually I have a little old userdir and "semi-installed" Ruby support. Not sure
if it could be somehow relative.