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 59452 - NPE from CloneableEditor#getHelpCtx
Summary: NPE from CloneableEditor#getHelpCtx
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-31 23:50 UTC by Peter Zavadsky
Modified: 2008-12-22 18:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Edited diff of suggested patch (671 bytes, patch)
2005-05-31 23:52 UTC, Peter Zavadsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Zavadsky 2005-05-31 23:50:59 UTC
There could be experienced NPE if called getHelpCtx method on CloneableEditor
component, which document was either not loaded yet, or closed already, i.e. its
support kit variable was null. See the attachment for suggested fix.
Comment 1 Peter Zavadsky 2005-05-31 23:52:33 UTC
Created attachment 22407 [details]
Edited diff of suggested patch
Comment 2 Peter Zavadsky 2005-05-31 23:53:51 UTC
Also a top of stack trace of the NPE we got:

java.lang.NullPointerException
        at org.openide.util.HelpCtx.findHelp(HelpCtx.java:192)
        at org.openide.text.CloneableEditor.getHelpCtx(CloneableEditor.java:118)
...
Comment 3 Petr Nejedly 2005-06-01 10:01:53 UTC
Fixed in 4.2:
openide/text/src/org/openide/text/CloneableEditor.java,v1.3

Anyway, who is calling the method in the described situation?
Comment 4 Peter Zavadsky 2005-06-01 18:09:39 UTC
It was not experienced in NB IDE, but in our product. 
And even in that caes, it wasn't reproducible. I just guess it could be some
race condition with our special help impl.
Anyway I think it is always good to make the openide more robust.
Comment 5 Viliam Sivaninec 2005-08-18 22:57:33 UTC
The fix was backported to release41_fixes branch.
/cvs/openide/src/org/openide/text/Attic/CloneableEditor.java
new revision: 1.82.14.1; previous revision: 1.82