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 162734 - ClassCastException: org.netbeans.tax.TreeComment cannot be cast to org.netbeans.tax.TreeDocumentType
Summary: ClassCastException: org.netbeans.tax.TreeComment cannot be cast to org.netbea...
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL: http://statistics.netbeans.org/except...
Keywords:
: 162739 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-15 16:58 UTC by Jaroslav Tulach
Modified: 2009-04-17 08:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 146339


Attachments
stacktrace (2.04 KB, text/plain)
2009-04-15 16:58 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2009-04-15 16:58:54 UTC
Build: NetBeans IDE Dev (Build 090406)
VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02
OS: Linux, 2.6.24.7-laptop-1mnb, i386

User Comments:
gorrus: created new action

jtulach: clicked finish in apisupport's new action wizard

gorrus: created a new action

jtulach: again

GUEST: creating new action



Stacktrace: 
java.lang.ClassCastException: org.netbeans.tax.TreeComment cannot be cast to org.netbeans.tax.TreeDocumentType
        at org.netbeans.modules.apisupport.project.layers.WritableXMLFileSystem.writeAttribute(WritableXMLFileSystem.java:849)
        at org.openide.filesystems.AbstractFileObject.setAttribute(AbstractFileObject.java:351)
        at org.openide.filesystems.AbstractFileObject.setAttribute(AbstractFileObject.java:334)
        at org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory$CreateLayerEntry$1.run(CreatedModifiedFilesFactory.java:545)
        at org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory$LayerModifications.run(CreatedModifiedFilesFactory.java:612)
        at org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory$CreateLayerEntry.run(CreatedModifiedFilesFactory.java:590)
Comment 1 Jaroslav Tulach 2009-04-15 16:58:59 UTC
Created attachment 80171 [details]
stacktrace
Comment 2 Jesse Glick 2009-04-15 18:05:05 UTC
*** Issue 162739 has been marked as a duplicate of this issue. ***
Comment 3 Jesse Glick 2009-04-15 18:09:43 UTC
Dupe was P2. Looks like jtulach's #2683baca2630 was incorrect:

  ((TreeDocumentType)doc.getChildNodes().get(0)).setPublicId("-//NetBeans//DTD Filesystem 1.2//EN");

assumes without justification that the the document begins with a <!DOCTYPE>. Need to skip over comments and handle
layers with no doctype. Should be easy to write a test for it.
Comment 4 Jaroslav Tulach 2009-04-16 08:33:10 UTC
Perfect, so I got caught into my own trap.
Comment 5 Jaroslav Tulach 2009-04-16 09:10:59 UTC
ergonomics#b9251d57bd73
Comment 6 Quality Engineering 2009-04-17 08:40:23 UTC
Integrated into 'main-golden', will be available in build *200904170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b9251d57bd73
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #162734: DOCTYPE does not need to be first elemet in the document