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 59568 - NullPointerException after (15 sec) creating a DataShadow of jsp dataobject
Summary: NullPointerException after (15 sec) creating a DataShadow of jsp dataobject
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP Parser (show other bugs)
Version: 4.x
Hardware: All All
: P1 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 59673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-02 23:32 UTC by Ayub Khan
Modified: 2006-03-24 13:00 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 Ayub Khan 2005-06-02 23:32:40 UTC
I have an application that tries to create a link (DataShadow) of a jsp 
dataobject, using

DataObject lnk=d.createShadow(destFolder),

where d is the source dataobject (of jsp), destFolder is the destination folder.

After the link gets created the IDE (NB4.1) throws a NullPointerException after 
15 seconds.

I have figured out the root cause of this issue (FS bug#6220423). It seems to 
be a bug in the NB4.1 code
(/web/jspsyntax/.../ErrorAnnotation.java:84)

- the root cause of this bug is NB4.1 in
/web/jspsyntax/.../ErrorAnnotation.java:84

---------------------------------------------------
    public void annotate(ErrorInfo[] errors){
...      
        // The approriate JText component
        JTextComponent component = editor.getOpenedPanes()[0]; <--- Null ptr
is thrown here if the document is not open while jsploader anaylses copied
document.
--------------------------------------------------------------------


In Summary, I would like NB4.1 to be fixed with the following line. Is fixing 
ErrorAnnotation.java is possible now.

/web/jspsyntax/.../ErrorAnnotation.java:84

---------------------------------------------------
    public void annotate(ErrorInfo[] errors){
  ...
       if(editor.getOpenedPanes()==null)
          return;

        // The approriate JText component
        JTextComponent component = editor.getOpenedPanes()[0];
--------------------------------------------------------------------


Note:
The NPE goes away, if I try to open (editor.open()) the jsp lnk immediately 
after create. Since this guarantees
"editor.getOpenedPanes()[0]" to return non-null. But this workaround will cause 
other issues, like IDE hang. I tried to enclose the editor.open() within a 
swing thread, but still there is deadlock.
Comment 1 Ayub Khan 2005-06-02 23:34:05 UTC
The following exception pops up:


Annotation: Exception occurred in Request Processor
java.lang.NullPointerException
	at org.netbeans.modules.web.core.syntax.spi.ErrorAnnotation.annotate
(ErrorAnnotation.java:84)
	at 
org.netbeans.modules.web.core.jsploader.TagLibParseSupport$ParsingRunnable.run
(TagLibParseSupport.java:346)
	at org.openide.util.Task.run(Task.java:189)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
[catch] at org.openide.util.RequestProcessor$Processor.run
(RequestProcessor.java:721)
Comment 2 Petr Pisl 2005-06-03 10:18:07 UTC
Thanks for the catching this. Your suggested fix is righ and I integrated it in
the trunk. 
Comment 3 Petr Pisl 2005-06-07 09:13:03 UTC
*** Issue 59673 has been marked as a duplicate of this issue. ***
Comment 4 zikmund 2005-06-30 11:21:53 UTC
V
Comment 5 pgebauer 2005-07-12 10:57:32 UTC
The bugfix was backported to release41_fixes branch.