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.
See issue #162771 for background. 1. Using 090521 (080a1f11d051) with cluster.config=basic, JDK 6, Ubuntu, fresh user dir. 2. Open attached XML file (linked to already from #162771 but attached here for your convenience). 3. Place caret after ':' in '<d:tag'. Press Ctrl-Space. Expected: completions from define.xsd displayed. Actual: exception is thrown: java.lang.NullPointerException at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.populateItemsForAny(CompletionUtil.java:508) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.substituteAny(CompletionUtil.java:499) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.getElements(CompletionUtil.java:239) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:110) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) .... Note that Validate XML on the same file succeeds.
Created attachment 82583 [details] Sample schema-controlled XML file
Code completion issue. Nikita, please take a look.
Alex, please take a look.
This bug is not reproduced now (NPE is not thrown any more) due to a fix for the bug http://www.netbeans.org/issues/show_bug.cgi?id=168513 (http://hg.netbeans.org/main/rev/354826c71921). But nevertheless a fix for this bug has been made to avoid a NPE throwing in the future. Fixed in trunk: http://hg.netbeans.org/main/rev/e82a68d87bc1
Integrated into 'main-golden', will be available in build *200907240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/e82a68d87bc1 User: Alex Petrov <alexpetrov@netbeans.org> Log: Fix for issue [#165747]: NPE from CompletionUtil.populateItemsForAny().
No more NPEs. Schema-driven code completion only seems to work maybe 20% of the time, with no apparent pattern, but at least it is not throwing a stream of exceptions any more.
*** Bug 166314 has been marked as a duplicate of this bug. ***