Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348251 - [console] IAE selecting OCLinEcore Outline element
Summary: [console] IAE selecting OCLinEcore Outline element
Status: CLOSED DUPLICATE of bug 348256
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 13:50 EDT by Ed Willink CLA
Modified: 2014-05-27 09:52 EDT (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 Ed Willink CLA 2011-06-03 13:50:26 EDT
Open the OCLinEcore Tutorial example.
Open Tutorial.ecore with OCLinEcore editor.
Open Xtext OCL Console.

Select "Book" in outline

java.lang.IllegalArgumentException: The feature 'ownedNestedPackage' is not a valid feature
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eStructuralFeature(BasicEObjectImpl.java:739)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentSegment(BasicEObjectImpl.java:533)
	at org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(EModelElementImpl.java:496)
	at org.eclipse.emf.ecore.impl.EPackageImpl.eObjectForURIFragmentSegment(EPackageImpl.java:1830)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:780)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:756)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:219)
	at org.eclipse.ocl.examples.xtext.console.OCLConsolePage$4.exec(OCLConsolePage.java:1074)
Comment 1 Ed Willink CLA 2011-11-10 15:04:32 EST
Cannot reproduce on Indigo SR1 or Juno M3.

This looks rather like https://bugs.eclipse.org/bugs/show_bug.cgi?id=348256#c2.

*** This bug has been marked as a duplicate of bug 348256 ***
Comment 2 Klaas Gadeyne CLA 2013-02-27 04:51:11 EST
(In reply to comment #1)
> Cannot reproduce on Indigo SR1 or Juno M3.
> 
> This looks rather like
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=348256#c2.
> 
> *** This bug has been marked as a duplicate of bug 348256 ***

I just encountered the same NPE on Kepler M5, but I also cannot reproduce it consistently :-(
Comment 3 Ed Willink CLA 2013-02-27 05:10:12 EST
(In reply to comment #2)
> I just encountered the same NPE on Kepler M5, but I also cannot reproduce it
> consistently :-(

Since this bug is an IAE, an NOE can hardly be the same. If you can post the stack trace (at least as far as sendEvent) this kind of bug is quite easy to fix.

(Generally there is an undue assumption that the model is valid. The Outline and Hover text etc work on whatever you have typed at the instant Xtext starts a parse; the result may therefore be in transition and so the Outline etc just needs to be more fault tolerant.)
Comment 4 Klaas Gadeyne CLA 2013-02-27 05:40:32 EST
(In reply to comment #3)
> (In reply to comment #2)
> > I just encountered the same NPE on Kepler M5, but I also cannot reproduce it
> > consistently :-(
> 
> Since this bug is an IAE, an NOE can hardly be the same. If you can post the
> stack trace (at least as far as sendEvent) this kind of bug is quite easy to
> fix.
> 
> (Generally there is an undue assumption that the model is valid. The Outline
> and Hover text etc work on whatever you have typed at the instant Xtext
> starts a parse; the result may therefore be in transition and so the Outline
> etc just needs to be more fault tolerant.)

Sorry, I did mean IAE!

stack trace below, but as you can see it is very similar to the one in the bug description.

java.lang.IllegalArgumentException: The feature 'ownedNestedPackage' is not a valid feature
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eStructuralFeature(BasicEObjectImpl.java:733)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentSegment(BasicEObjectImpl.java:527)
	at org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(EModelElementImpl.java:489)
	at org.eclipse.emf.ecore.impl.EPackageImpl.eObjectForURIFragmentSegment(EPackageImpl.java:1829)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:777)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:753)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
	at org.eclipse.emf.edit.ui.util.EditUIMarkerHelper.getTargetObjects(EditUIMarkerHelper.java:190)
	at org.eclipse.emf.edit.ui.util.EditUIMarkerHelper.getMarkerDiagnostics(EditUIMarkerHelper.java:273)
	at org.eclipse.emf.edit.ui.provider.DiagnosticDecorator$DiagnosticDecoratorAdapter.handleResourceDiagnostics(DiagnosticDecorator.java:762)
	at org.eclipse.emf.edit.ui.provider.DiagnosticDecorator$DiagnosticAdapter.notifyChanged(DiagnosticDecorator.java:214)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.unload(ResourceImpl.java:1681)
	at org.eclipse.emf.ecore.presentation.EcoreEditor.handleChangedResources(EcoreEditor.java:696)
	at org.eclipse.emf.ecore.presentation.EcoreEditor.handleActivateGen(EcoreEditor.java:639)
	at org.eclipse.emf.ecore.presentation.EcoreEditor.handleActivate(EcoreEditor.java:671)
	at org.eclipse.emf.ecore.presentation.EcoreEditor$1.partActivated(EcoreEditor.java:357)
	at org.eclipse.ui.internal.WorkbenchPage$11.run(WorkbenchPage.java:4454)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.WorkbenchPage.firePartActivated(WorkbenchPage.java:4452)
	at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:4440)
	at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:173)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$2.run(PartServiceImpl.java:193)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:191)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:596)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:549)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:105)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:61)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4155)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1489)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1470)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1569)
	at org.eclipse.swt.widgets.Control.sendMouseEvent(Control.java:3379)
	at org.eclipse.swt.widgets.Tree.sendMouseEvent(Tree.java:2656)
	at org.eclipse.swt.widgets.Control.mouseEvent(Control.java:2532)
	at org.eclipse.swt.widgets.Composite.mouseEvent(Composite.java:886)
	at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2540)
	at org.eclipse.swt.widgets.Tree.mouseDown(Tree.java:2012)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5532)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2104)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2312)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5596)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5035)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5184)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3637)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1057)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:941)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:79)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
Comment 5 Ed Willink CLA 2013-02-27 05:55:55 EST
(In reply to comment #2)
> I just encountered the same NPE on Kepler M5

Definitely not the saem. The original had

org.eclipse.ocl.examples.xtext.console.OCLConsolePage$4.exec(OCLConsolePage.java:1074)

as the last application-specific frame beforee generic EMF support.

Your trace has

org.eclipse.emf.edit.ui.util.EditUIMarkerHelper.getTargetObjects(EditUIMarkerHelper.java:190)
	at org.eclipse.emf.edit.ui.util.EditUIMarkerHelper.getMarkerDiagnostics(EditUIMarkerHelper.java:273)
	at org.eclipse.emf.edit.ui.provider.DiagnosticDecorator$DiagnosticDecoratorAdapter.handleResourceDiagnostics(DiagnosticDecorator.java:762)

and no "ocl" anywhere. This looks much more like Bug 400393, which is only indirectly affected by OCL tooling.
Comment 6 Ed Willink CLA 2014-05-27 09:44:35 EDT
CLOSED after more than a year in RESOLVED state.
Comment 7 Ed Willink CLA 2014-05-27 09:52:49 EDT
and CLOSE