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.
DTDParser starts with a null 'res' variable in parse(InputSource) and continues later on to check for this: if (res != null) { parser.setEntityResolver(res); } At the end of the method though we get a possible NPE in the call: dtdGrammar.setResolvedEntities(res.getResolvedSystemIds()); More to the point, I got the following stacktrace since I had no default UserCatalog (on a custom configuration). SEVERE: Error in RequestProcessor org.netbeans.spi.editor.completion.support.AsyncCompletionTask java.lang.NullPointerException at org.netbeans.modules.xml.dtd.grammar.DTDParser.parse(DTDParser.java:139) at org.netbeans.modules.xml.dtd.grammar.DTDGrammarQueryProvider.getGrammar(DTDGrammarQueryProvider.java:74) at org.netbeans.modules.xml.api.model.GrammarQueryManager$DefaultQueryManager.getGrammar(GrammarQueryManager.java:151) at org.netbeans.modules.xml.text.completion.GrammarManager.loadGrammar(GrammarManager.java:316) at org.netbeans.modules.xml.text.completion.GrammarManager.getGrammar(GrammarManager.java:133) at org.netbeans.modules.xml.text.completion.XMLCompletionQuery.getPerformer(XMLCompletionQuery.java:297) at org.netbeans.modules.xml.text.completion.XMLCompletionQuery.queryElements(XMLCompletionQuery.java:309) at org.netbeans.modules.xml.text.completion.XMLCompletionQuery.query(XMLCompletionQuery.java:125) at org.netbeans.modules.xml.text.completion.XMLCompletionProvider$Query.query(XMLCompletionProvider.java:122) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1960)
Created attachment 102737 [details] Patch which fixes the issue
Changeset: 508f49c5bced Author: Svata Dedic <sdedic@netbeans.org> Date: 2012-03-23 14:17 Message: Issue #191072 - Unchecked NPE in org.netbeans.modules.xml.dtd.grammar.DTDParser.parse: fixed Check for null resolver
Thanks for the report - and for the patch ! Sorry for the resolution took such a while.
Integrated into 'main-golden', will be available in build *201203240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/508f49c5bced User: Svata Dedic <sdedic@netbeans.org> Log: Issue #191072 - Unchecked NPE in org.netbeans.modules.xml.dtd.grammar.DTDParser.parse: fixed Check for null resolver