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 96976 - NPE after typing & in an XML document
Summary: NPE after typing & in an XML document
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-01 17:23 UTC by Mikhail Kondratyev
Modified: 2007-03-07 21:07 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 Mikhail Kondratyev 2007-03-01 17:23:30 UTC
Steps to reproduce:
 - create an XML document
 - type & and then any letter after an opening xml tag. For example:
<xml-tag> &h
</xml-tag>

 - at the moment when you type 'h' in this scenario NPE will be thrown:
java.lang.NullPointerException
	at
org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:82)
	at
org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:74)
	at
org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:195)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 1 Samaresh Panda 2007-03-01 18:04:11 UTC
Which build are you using? The stack trace and the source do not match. Please
try this with a newer build. I'm not able to reproduce.
Comment 2 Mikhail Kondratyev 2007-03-01 18:14:25 UTC
I'm using Milestone 7b build.
We will switch as soon as Beta testing is over and I will try to reproduce once
more.

With Milestone 7b several engineers could reproduce it.
Comment 3 htt 2007-03-01 18:17:09 UTC
Reproducible with 070301_5....

Create an empty newXMLDocument.xml.
Simply type <xml-tag> &h => exception below

java.lang.NullPointerException
        at
org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:79)
        at
org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:57)
        at
org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:195)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 4 Samaresh Panda 2007-03-01 18:48:03 UTC
OK, I see it now. I was using the snippet as in the initial description, that is:
<xml-tag> &h
</xml-tag>

Where as, the trick is:
<xml-tag> &h
Comment 5 Samaresh Panda 2007-03-01 19:07:32 UTC
/cvs/xml/schema/completion/src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImpl.java,v
 <--  CompletionContextImpl.java
new revision: 1.1.2.16; previous revision: 1.1.2.15
Comment 6 htt 2007-03-07 21:07:27 UTC
Verified in 070307_5.