Bug 65870 - [1.5] AST creation fails when created with comments
Summary: [1.5] AST creation fails when created with comments
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 66152 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-05 11:33 EDT by Martin Aeschlimann CLA
Modified: 2005-01-11 11:02 EST (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 Martin Aeschlimann CLA 2004-06-05 11:33:37 EDT
Cheetah 20040605

- I changed our code in NewTypeWizardPage.constructCUContent to use the JLS1.5 AST
- Create a new type -> UnsupportedOperationException
- the 'setComment' code can probbably be skipped (commented out) as also
getComment is not available anymore


Caused by: java.lang.UnsupportedOperationException: Operation only supported in
JLS2 AST
	at java.lang.Throwable.<init>(Throwable.java)
	at java.lang.Throwable.<init>(Throwable.java:73)
	at org.eclipse.jdt.core.dom.ASTNode.supportedOnlyIn2(ASTNode.java:1775)
	at org.eclipse.jdt.core.dom.Javadoc.setComment(Javadoc.java:235)
	at org.eclipse.jdt.core.dom.DocCommentParser.setComment(DocCommentParser.java:74)
	at org.eclipse.jdt.core.dom.DocCommentParser.parse(DocCommentParser.java:63)
	at org.eclipse.jdt.core.dom.DocCommentParser.parse(DocCommentParser.java:49)
	at org.eclipse.jdt.core.dom.ASTConverter.createComment(ASTConverter.java:2333)
	at org.eclipse.jdt.core.dom.ASTConverter.buildCommentsTable(ASTConverter.java:233)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:941)
	at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:719)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:678)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
	at
org.eclipse.jdt.ui.wizards.NewTypeWizardPage.constructCUContent(NewTypeWizardPage.java:1583)
	at
org.eclipse.jdt.ui.wizards.NewTypeWizardPage.createType(NewTypeWizardPage.java:1443)
	at
org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard.finishPage(NewClassCreationWizard.java:55)
	at
org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:108)
	at
org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:34)
	at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:700)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1673)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3312)
	at
org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:65)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
Comment 1 Olivier Thomann CLA 2004-06-07 10:18:43 EDT
We should call the setComment(...) only if the astLevel is JLS2. For the
getComment(), there is nothing we can do.
All calls to getComment() are protected by checking that JLS level is JLS2.
Comment 2 Olivier Thomann CLA 2004-06-07 12:12:30 EDT
This will be fixed in the 1.5 stream only.
Comment 3 Olivier Thomann CLA 2004-06-07 13:35:20 EDT
Fixed and released in 1.5 stream
Comment 4 Luc Bourlier CLA 2004-06-10 13:26:14 EDT
*** Bug 66152 has been marked as a duplicate of this bug. ***