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 120777 - NullPointerException at org.netbeans.modules.xml.dtd.grammar.ContentModel$MultiplicityGroup.eat
Summary: NullPointerException at org.netbeans.modules.xml.dtd.grammar.ContentModel$Mul...
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Samaresh Panda
URL: http://statistics.netbeans.org/except...
Keywords:
: 123780 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-01 11:06 UTC by mrabbah
Modified: 2008-03-28 01:15 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 10134


Attachments
stacktrace (1.26 KB, text/plain)
2007-11-01 11:07 UTC, mrabbah
Details
stacktrace (1.36 KB, text/plain)
2008-02-18 19:01 UTC, misterm
Details
stacktrace (1.36 KB, text/plain)
2008-03-11 18:18 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mrabbah 2007-11-01 11:06:58 UTC
Build: NetBeans IDE 6.0 Beta 2 (Build 200710212201)
VM: Java HotSpot(TM) Client VM, 1.6.0-b105
OS: Windows XP, 5.1, x86

User Comments:
Comment 1 mrabbah 2007-11-01 11:07:04 UTC
Created attachment 52235 [details]
stacktrace
Comment 2 Sonali Kochar 2007-11-01 18:42:53 UTC
Can you provide the steps the reproduce this bug?
Comment 3 Samaresh Panda 2008-01-10 02:42:58 UTC
It'll be good if you could attach the xml and the dtd file.
Comment 4 Samaresh Panda 2008-01-10 02:44:42 UTC
*** Issue 123780 has been marked as a duplicate of this issue. ***
Comment 5 Samaresh Panda 2008-01-25 22:04:42 UTC
Sonali, please add a check and mark it fixed. Unless the reporter gives more info, it'll be difficult to reproduce.
Comment 6 misterm 2008-02-18 19:01:43 UTC
Build: NetBeans IDE Dev (Build 200801280931)
VM: Java HotSpot(TM) Client VM, 10.0-b19
OS: Windows XP, 5.1, x86

User Comments: 
Just typing inside a xml file
Comment 7 misterm 2008-02-18 19:01:50 UTC
Created attachment 56830 [details]
stacktrace
Comment 8 Michel Graciano 2008-03-11 18:18:20 UTC
Build: NetBeans IDE 6.1 Beta (Build 200803050202)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
Comment 9 Michel Graciano 2008-03-11 18:18:26 UTC
Created attachment 58183 [details]
stacktrace
Comment 10 Michel Graciano 2008-03-11 18:27:20 UTC
Try the code completion for the <panel> indicated, trying to use another element instead 'panel':

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE panel PUBLIC '-//Thinlets 1.0//EN' 'https://thinlet.dev.java.net/thinlet.dtd'>
<panel weightx="1" weighty="1" columns="1" gap="5" top="5" left="5" bottom="5" right="5">
   <panel weightx="1" weighty="1" columns="1" gap="5" top="5" left="5" bottom="5" right="5">
      <panel weightx="1" weighty="1" columns="1" gap="5" top="5" left="5" bottom="5" right="5">
      </panel>
      <panel/> <!--Try code completion for this panel-->
      <panel/>
      <panel/>
   </panel>
</panel>
Comment 11 Samaresh Panda 2008-03-27 22:36:30 UTC
hmichel, I'm trying this with 6.1 and works fine. Do you want to try in 6.1beta and let us know?
Comment 12 tonybeckham 2008-03-27 22:44:51 UTC
Product Version: NetBeans IDE Dev (Build 200803251204)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.2 running on i386; MacRoman; en_US (nb)

I can reproduce with the code supplied.  First invocation of CC where is stated is fine, but when starting a new tag the
exception happens.
Comment 13 tonybeckham 2008-03-27 22:47:20 UTC
Invoking CC manually for existing tag in this case is fine, when CC automatically begins when creating new tag is when
exception happens.

java.lang.NullPointerException
	at org.netbeans.modules.xml.dtd.grammar.ContentModel$MultiplicityGroup.eat(ContentModel.java:409)
	at org.netbeans.modules.xml.dtd.grammar.ContentModel$Sequence.eat(ContentModel.java:300)
	at org.netbeans.modules.xml.dtd.grammar.ContentModel.whatCanFollow(ContentModel.java:171)
	at org.netbeans.modules.xml.dtd.grammar.DTDGrammar.queryElements(DTDGrammar.java:217)
	at org.netbeans.modules.xml.text.completion.XMLCompletionQuery.queryElements(XMLCompletionQuery.java:319)
	at org.netbeans.modules.xml.text.completion.XMLCompletionQuery.query(XMLCompletionQuery.java:139)
	at org.netbeans.modules.xml.text.completion.XMLCompletionProvider.queryImpl(XMLCompletionProvider.java:135)
	at org.netbeans.modules.xml.text.completion.XMLCompletionProvider.access$000(XMLCompletionProvider.java:67)
	at org.netbeans.modules.xml.text.completion.XMLCompletionProvider$Query.doQuery(XMLCompletionProvider.java:105)
	at org.netbeans.modules.xml.text.completion.XMLCompletionProvider$Query.query(XMLCompletionProvider.java:117)
	at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Comment 14 Samaresh Panda 2008-03-27 22:57:27 UTC
Ok, I see; will fix it.
Comment 15 tonybeckham 2008-03-27 23:13:08 UTC
I can only reproduce with that specific DTD that the document is based on.  Others from the built-in catalog work for
this scenario.  Basically if a tag is self terminating (ie <foo/>) then the next tag started will give NPE.

Easy steps to reproduce:
1. Uncomment the tag noted here:

<!DOCTYPE panel PUBLIC '-//Thinlets 1.0//EN' 'https://thinlet.dev.java.net/thinlet.dtd'>
<panel>
     <!-- <popupmenu/> -->
</panel>

2. attempt to add a new tag after it, you will see problem
Comment 16 Samaresh Panda 2008-03-28 01:15:19 UTC
Fix integrated: http://hg.netbeans.org/main/rev/1bebd339db6d.