Community
Participate
Working Groups
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)
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.
This will be fixed in the 1.5 stream only.
Fixed and released in 1.5 stream
*** Bug 66152 has been marked as a duplicate of this bug. ***