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 165747 - XML code completion broken: NPE from CompletionUtil.populateItemsForAny
Summary: XML code completion broken: NPE from CompletionUtil.populateItemsForAny
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ alexpetrov
URL:
Keywords:
: 166314 (view as bug list)
Depends on:
Blocks: 162771
  Show dependency tree
 
Reported: 2009-05-21 20:56 UTC by Jesse Glick
Modified: 2012-03-26 09:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample schema-controlled XML file (813 bytes, text/xml)
2009-05-21 20:57 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-05-21 20:56:07 UTC
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.
Comment 1 Jesse Glick 2009-05-21 20:57:17 UTC
Created attachment 82583 [details]
Sample schema-controlled XML file
Comment 2 Sergey Lunegov 2009-06-11 12:18:19 UTC
Code completion issue. Nikita, please take a look.
Comment 3 Sergey Lunegov 2009-07-16 16:30:42 UTC
Alex, please take a look.
Comment 4 _ alexpetrov 2009-07-23 13:33:38 UTC
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
Comment 5 Quality Engineering 2009-07-24 05:41:46 UTC
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().
Comment 6 Jesse Glick 2009-07-24 17:09:30 UTC
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.
Comment 7 Svata Dedic 2012-03-26 09:03:50 UTC
*** Bug 166314 has been marked as a duplicate of this bug. ***