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.
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.
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)
Thanks for the catching this. Your suggested fix is righ and I integrated it in the trunk.
*** Issue 59673 has been marked as a duplicate of this issue. ***
V
The bugfix was backported to release41_fixes branch.