Bug 474920 - [dom ast] Bad AST node structure for source that ends with XML
Summary: [dom ast] Bad AST node structure for source that ends with XML
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-13 12:19 EDT by Markus Keller CLA
Modified: 2022-08-30 06:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2015-08-13 12:19:46 EDT
4.6.0.I20150805-2000

Bad AST node structure:
- parent [34, 427] org.eclipse.jdt.core.dom.EnumDeclaration
   previous [166, 169] org.eclipse.jdt.core.dom.EnumConstantDeclaration
   bodyDeclarations [136, 146] org.eclipse.jdt.core.dom.FieldDeclaration

----------------------------------- SOURCE BEGIN -------------------------------------
    //Example: Code fragment
    @XmlEnum(String.class)
    public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }

    <!-- Example: XML Schema fragment -->
    <xs:simpleType name="Card">
      <xs:restriction base="xs:string"/>
        <xs:enumeration value="CLUBS"/>
        <xs:enumeration value="DIAMONDS"/>
        <xs:enumeration value="HEARTS"/>
        <xs:enumeration value="SPADES"/>
    </xs:simpleType>

----------------------------------- SOURCE END -------------------------------------

java.lang.IllegalStateException: Bad AST node structure
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1419)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:295)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1216)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:812)
	at org.eclipse.jdt.internal.ui.refactoring.reorg.PasteAction$TextPaster$ParsedCu.parseCus(PasteAction.java:378)
...

The given source is embedded in a <pre> section in the Javadoc of javax.xml.bind.annotation.XmlEnumValue. Found the problem because the formatter creates an AST for code snippets, and I had the debug/dom/ast trace option enabled.
Comment 1 Eclipse Genie CLA 2020-08-28 17:35:29 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Eclipse Genie CLA 2022-08-30 06:31:56 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.