Bug 519379 - class org.eclipse.wst.jsdt.core.dom.EmptyStatement is not assignable to class org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration
Summary: class org.eclipse.wst.jsdt.core.dom.EmptyStatement is not assignable to class...
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.9 (Oxygen)   Edit
Hardware: PC Windows 8
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-07 07:13 EDT by Missing name CLA
Modified: 2017-11-30 07:09 EST (History)
2 users (show)

See Also:


Attachments
The Problem File - schemaBuilder.js (14.15 KB, text/plain)
2017-11-30 06:15 EST, Adrian Velcich CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2017-07-07 07:13:49 EDT
What steps will reproduce the problem?
1.  open javascript file
2. 
3. 


-- Error Details --
Date: Fri Jul 07 13:10:59 CEST 2017
Message: class org.eclipse.wst.jsdt.core.dom.EmptyStatement is not assignable to class org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration
Severity: Error
Product: Eclipse Platform 4.7.0.v20170612-0950 (org.eclipse.platform.ide)
Plugin: org.eclipse.wst.jsdt.core
Session Data:
eclipse.buildId=4.7.0.I20170612-0950
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data file:/C:/Java/eclipse-workspace/

Exception Stack Trace:
java.lang.ClassCastException: class org.eclipse.wst.jsdt.core.dom.EmptyStatement is not assignable to class org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration
	at org.eclipse.wst.jsdt.core.dom.ASTNode.checkNewChild(ASTNode.java:1830)
	at org.eclipse.wst.jsdt.core.dom.ASTNode$NodeList.add(ASTNode.java:1216)
	at org.eclipse.wst.jsdt.core.dom.ASTNode$NodeList.add(ASTNode.java:1)
	at java.util.AbstractList.add(AbstractList.java:108)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.processFunction(ClosureCompilerASTConverter.java:819)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.process(ClosureCompilerASTConverter.java:229)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.transform(ClosureCompilerASTConverter.java:128)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.processClassDeclaration(ClosureCompilerASTConverter.java:566)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.process(ClosureCompilerASTConverter.java:302)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.transform(ClosureCompilerASTConverter.java:128)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.transformAndSetProperty(ClosureCompilerASTConverter.java:1680)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.processExportDecl(ClosureCompilerASTConverter.java:684)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.process(ClosureCompilerASTConverter.java:311)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.transform(ClosureCompilerASTConverter.java:128)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.processAstRoot(ClosureCompilerASTConverter.java:487)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.process(ClosureCompilerASTConverter.java:263)
	at org.eclipse.wst.jsdt.core.dom.ClosureCompilerASTConverter.transform(ClosureCompilerASTConverter.java:128)
	at org.eclipse.wst.jsdt.internal.compiler.closure.ClosureCompiler.parse(ClosureCompiler.java:120)
	at org.eclipse.wst.jsdt.core.dom.ASTParser.createAST(ASTParser.java:652)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:171)
	at org.eclipse.wst.jsdt.internal.core.Openable.generateInfos(Openable.java:243)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:538)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:282)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:268)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getChildren(JavaElement.java:216)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getChildrenOfType(JavaElement.java:230)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.getTypes(CompilationUnit.java:926)
	at org.eclipse.wst.jsdt.internal.core.NameLookup.<init>(NameLookup.java:219)
	at org.eclipse.wst.jsdt.internal.core.JavaProjectElementInfo.newNameLookup(JavaProjectElementInfo.java:342)
	at org.eclipse.wst.jsdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2391)
	at org.eclipse.wst.jsdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:79)
	at org.eclipse.wst.jsdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:89)
	at org.eclipse.wst.jsdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:98)
	at org.eclipse.wst.jsdt.internal.core.JavaProject.newSearchableNameEnvironment(JavaProject.java:2416)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.newSearchableNameEnvironment(JavaElement.java:872)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.newSearchableNameEnvironment(JavaElement.java:872)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.newSearchableNameEnvironment(JavaElement.java:872)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.newSearchableNameEnvironment(CompilationUnit.java:1481)
	at org.eclipse.wst.jsdt.internal.core.Openable.codeSelect(Openable.java:151)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:240)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:234)
	at org.eclipse.wst.jsdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:213)
	at org.eclipse.wst.jsdt.internal.ui.actions.SelectionConverter$1CodeResolveRunnable.run(SelectionConverter.java:197)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Comment 1 Nitin Dahyabhai CLA 2017-07-07 11:00:29 EDT
Which file you're opening would matter significantly in this case.
Comment 2 Missing name CLA 2017-07-08 05:27:09 EDT
I cannot attach an example file, it was a js file from an AngularJS1 project if that helps.
Comment 3 Adrian Velcich CLA 2017-11-30 06:15:21 EST
Created attachment 271708 [details]
The Problem File - schemaBuilder.js
Comment 4 Adrian Velcich CLA 2017-11-30 06:16:18 EST
I have the same problem, but only with one specific .JS file. Other .JS files in the same folder are fine, there is no problem with them.

I have attached the problem file. The original, unmodified file for reference is  available at https://github.com/Vincit/objection-graphql/blob/master/lib/SchemaBuilder.js

What steps will reproduce the problem:

The problem seemed to start when trying to save the file I was editing. I got a msg saying that the file save was unsuccessful (Null Pointer Error). Note that although I got the 'File Save Unsuccessful' error, the file (with my edits) was saved sucessfully, I verified this in a text editor. 

I then closed the file and tried to reopen it, and this is when I get the "class org.eclipse.wst.jsdt.core.dom.EmptyStatement is not assignable to class org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration" error, with the editor pane message saying "Failed to create the part's controls".

I tried switching to 'Open With' with both the 'Text Editor' and 'Generic Text Editor'. Still unable to open the file.

I got the problem to go away momentarily by uninstalling and reinstalling the DarkestDark Theme, and was then able to load the file. But the moment I tried to save it again, the 'File Save Unsuccessful' error was back. I then closed the file and was unable to open it again.

I then deleted the .JS file, and fetched a fresh copy from GitHub. Still unable to load the file.

I then downloaded and installed a fresh copy of Eclipse Oxygen (for Javascript devs). Still unable to load the file. 

Please help!


-- Error Details -- 

The 'details' dropdown on the now blank editor page conatins this:

java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:172)
	at org.eclipse.wst.jsdt.internal.core.Openable.generateInfos(Openable.java:243)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:538)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:282)
	at org.eclipse.wst.jsdt.internal.core.JavaElement.getElementInfo(JavaElement.java:268)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.getSourceRange(CompilationUnit.java:912)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.selectionactions.GoToNextPreviousMemberAction.update(GoToNextPreviousMemberAction.java:83)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.selectionactions.GoToNextPreviousMemberAction.<init>(GoToNextPreviousMemberAction.java:62)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.selectionactions.GoToNextPreviousMemberAction.newGoToNextMemberAction(GoToNextPreviousMemberAction.java:49)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor.createActions(JavaEditor.java:2317)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditor.createActions(CompilationUnitEditor.java:1029)
	at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3463)
	at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:61)
	at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:445)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor.createPartControl(JavaEditor.java:2626)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditor.createPartControl(CompilationUnitEditor.java:1412)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:151)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:355)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:990)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:992)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:661)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1293)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:68)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4889)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:52)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:173)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:620)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:584)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:769)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:401)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1188)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3261)
	at org.eclipse.ui.internal.WorkbenchPage.access$25(WorkbenchPage.java:3176)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:3158)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3153)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3117)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3107)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:563)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:518)
	at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:100)
	at org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditorAction.java:97)
	at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:216)
	at org.eclipse.ui.navigator.CommonNavigatorManager$2.open(CommonNavigatorManager.java:191)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:46)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:851)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:848)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1163)
	at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:451)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:273)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:268)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:308)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Comment 5 Adrian Velcich CLA 2017-11-30 07:09:31 EST
After some additional tinkering, starting with a fresh, virgin file, it now works fine??? My edits are back in, and the file is now saving, closing and opening fine.

I have no idea what caused it, except possibly for a hidden bad character in the file?