Community
Participate
Working Groups
Build Identifier: TPTP-4.7.0-201005251601 related to : Test.Execution.JUnitPluginRunner Test.Execution.JUnitRunner test case : Generate_Source_Code* Reproducible: Always Steps to Reproduce: 1.Have a TPTP JUnit/JUnitPlugin test open in its editor 2.Under the Source Information section, change the Package name to "&" and try to save 3.Notice the error message ". is not a valid Java identifier 4.Enter a valid Package name, change the Class name to "&" and try to save 5.Notice the error message "The type name ". is not a valid identifier" 6.Change the Class name to "$" and try to save 7.Notice the exception: java.lang.ClassCastException: org.eclipse.jdt.core.dom.CompilationUnit incompatible with org.eclipse.jdt.core.dom.TypeDeclaration at org.eclipse.hyades.test.tools.core.internal.common.codegen.ASTHelper.parseMethod(ASTHelper.java:104) at org.eclipse.hyades.test.tools.core.internal.java.codegen.JUnitGenerator.updateSuiteMethod(JUnitGenerator.java:213) at org.eclipse.hyades.test.tools.core.internal.java.codegen.JUnitGenerator.createSourceUpdateChange(JUnitGenerator.java:139) at org.eclipse.hyades.test.tools.core.internal.common.codegen.JavaGenerator.createUpdateChange(JavaGenerator.java:244) at org.eclipse.hyades.test.tools.core.internal.common.codegen.Generator.createChange(Generator.java:218) at org.eclipse.hyades.test.tools.ui.java.internal.junit.editor.JUnitEditorExtension.performChange(JUnitEditorExtension.java:161) at org.eclipse.hyades.test.tools.ui.java.internal.junit.editor.JUnitEditorExtension.save(JUnitEditorExtension.java:116) at org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension$1.execute(BaseEditorExtension.java:242) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.doSave(BaseEditorExtension.java:264) at org.eclipse.hyades.ui.internal.editor.HyadesEditorPart.doSave(HyadesEditorPart.java:301) at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:151) at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:277) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2600) at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:285) at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:264) at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:156) at org.eclipse.ui.internal.EditorManager.savePart(EditorManager.java:1369) at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage.java:3334) at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3347) at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:76) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1051) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1065) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1102) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1098) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1507) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4267) at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4159) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
First two scenarios are caused by JDT defect 314740. The last scenario is unreproducible in the TPTP-4.7.0-201005251601 build.
After a closer inspection of the code, the error messages returned from the JDT APIs are in fact correct (see JDT defect 314740). The symptom is caused by the org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation not displaying the error message correctly in the wizard (see calls to org.eclipse.hyades.test.core.util.JavaUtil.validatePackageName(String) and org.eclipse.hyades.test.core.util.JavaUtil.validateClassName(String) invoked by line 177 in org.eclipse.hyades.test.tools.ui.java.internal.junit.editor.JUnitEditorExtension.performChange(Refactoring)).
Minor issue that may require translation. As such, deferring.
Insufficient resources to complete.
This defect had been resolved as WONTFIX for more than 1 month. Closing this on the reporter's behalf. Please re-open if you have further comment on this issue.
Closed in TPTP 4.7.2.