angelozerr/tern.java — pull request #156 by vrubezhny (2014-10-17 17:31:28+00:00)
Title: Move Class Path congifuration into a Workspace Job due to prevent the

resource exceptions on a locked workspace:

org.eclipse.core.internal.resources.ResourceException: The resource tree is locked for modifications.
at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:116)
at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:2251)
at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1322)
at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1376)
at tern.eclipse.ide.core.TernNature.configure(TernNature.java:59)
at tern.eclipse.ide.internal.core.IDETernProject.ensureNatureIsConfigured(IDETernProject.java:817)
at tern.eclipse.ide.internal.core.IDETernProject.(IDETernProject.java:111)
at tern.eclipse.ide.internal.core.IDETernProject.getTernProject(IDETernProject.java:134)
at tern.eclipse.ide.core.TernCorePlugin.getTernProject(TernCorePlugin.java:99)
at tern.eclipse.ide.jsdt.internal.JSDTClassPathManager.elementChanged(JSDTClassPathManager.java:67)
at org.eclipse.wst.jsdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1591)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.wst.jsdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1581)
at org.eclipse.wst.jsdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1416)
at org.eclipse.wst.jsdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1392)
at org.eclipse.wst.jsdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1945)
at org.eclipse.wst.jsdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:389)
at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:378)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1498)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2322)
at org.eclipse.wst.jsdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:807)
at org.eclipse.wst.jsdt.internal.core.JavaProject.setRawIncludepath(JavaProject.java:2992)
at org.eclipse.wst.jsdt.internal.core.JavaProject.setRawIncludepath(JavaProject.java:3023)
at org.eclipse.thym.ui.wizard.project.HybridProjectCreator.setUpJavaScriptProject(HybridProjectCreator.java:135)
at org.eclipse.thym.ui.wizard.project.HybridProjectCreator.createProject(HybridProjectCreator.java:104)
at org.eclipse.thym.ui.wizard.project.HybridProjectCreator.createBasicTemplatedProject(HybridProjectCreator.java:78)
at org.eclipse.thym.ui.wizard.project.NewHybridProjectWizard$1.run(NewHybridProjectWizard.java:91)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1059)
at org.eclipse.thym.ui.wizard.project.NewHybridProjectWizard.performFinish(NewHybridProjectWizard.java:103)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4486)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3831)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3441)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
at org.eclipse.jface.window.Window.open(Window.java:808)
at org.jboss.tools.central.editors.GettingStartedPage.openWizard(GettingStartedPage.java:697)
at org.jboss.tools.central.editors.GettingStartedPage.access$14(GettingStartedPage.java:682)
at org.jboss.tools.central.editors.GettingStartedPage$7.linkActivated(GettingStartedPage.java:636)
at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:233)
at org.eclipse.ui.forms.widgets.ImageHyperlink.handleActivate(ImageHyperlink.java:199)
at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:327)
at org.eclipse.ui.forms.widgets.AbstractHyperlink.access$2(AbstractHyperlink.java:311)
at org.eclipse.ui.forms.widgets.AbstractHyperlink$4.handleEvent(AbstractHyperlink.java:125)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4486)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3831)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3441)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
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:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

Reference issue: https://issues.jboss.org/browse/JBIDE-18591

Signed-off-by: vrubezhny