Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UML2Util : NPE using EMF Compare
UML2Util : NPE using EMF Compare [message #628437] Thu, 06 May 2010 14:03
Tristan Faure is currently offline Tristan Faure
Messages: 227
Registered: July 2009
Senior Member
Hi everyone,

I am facing issue using EMF Compare on model.
Indeed, in some case a NPE is raised on UML2Util. In my case in the
getResourceBundle() method an inpustream is null. When the stream is
closed (l442) the NPE is raised.

By your opinion, is this inpustream can be null ?
If not what can be the reason of this behavior ? If yes shall we not
test nullity condition on inputstream before closing it ?

Test using TOPCASED (Eclipse UML2 2.2.2.v200902101430):
In Project explorer, Right click on UML file, Compare with, Local
History ==> NPE during model comparison.

I have already asked this question to EMFT newsgroup
( http://www.eclipse.org/forums/index.php?t=msg&th=167711& amp;start=0&).
But I was wondering about this inputstream behavior.

Stacktrace :

!ENTRY org.eclipse.jface 4 2 2010-05-05 14:43:57.609
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.uml2.common.util.UML2Util.getResourceBundle(UML2 Util.java:442)
at
org.eclipse.uml2.common.util.UML2Util.getResourceBundle(UML2 Util.java:472)
at org.eclipse.uml2.common.util.UML2Util.getString(UML2Util.jav a:498)
at
org.eclipse.uml2.uml.internal.operations.NamedElementOperati ons.getLabel(NamedElementOperations.java:246)
at
org.eclipse.uml2.uml.internal.impl.NamedElementImpl.getLabel (NamedElementImpl.java:557)
at
org.eclipse.uml2.uml.edit.providers.LiteralBooleanItemProvid er.getText(LiteralBooleanItemProvider.java:119)
at
org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider .getText(AdapterFactoryLabelProvider.java:380)
at
org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText (WrappedViewerLabelProvider.java:108)
at
org.eclipse.jface.viewers.WrappedViewerLabelProvider.update( WrappedViewerLabelProvider.java:164)
at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn. java:145)
at
org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(Ab stractTreeViewer.java:932)
at
org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeR unnable.run(AbstractTreeViewer.java:102)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(Ab stractTreeViewer.java:1012)
at
org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRun nable.run(StructuredViewer.java:481)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.updateItem(Struct uredViewer.java:2111)
at
org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem( AbstractTreeViewer.java:827)
at
org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:802)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
at
org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:639)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandT oLevel(AbstractTreeViewer.java:1709)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandT oLevel(AbstractTreeViewer.java:1719)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandT oLevel(AbstractTreeViewer.java:1719)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandT oLevel(AbstractTreeViewer.java:1719)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandT oLevel(AbstractTreeViewer.java:1719)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandT oLevel(AbstractTreeViewer.java:1719)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandT oLevel(AbstractTreeViewer.java:1719)
at
org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(A bstractTreeViewer.java:1054)
at
org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(A bstractTreeViewer.java:1035)
at
org.eclipse.jface.viewers.AbstractTreeViewer.expandAll(Abstr actTreeViewer.java:1024)
at
org.eclipse.emf.compare.ui.viewer.content.part.diff.ModelCon tentMergeDiffTab.inputChanged(ModelContentMergeDiffTab.java: 369)
at
org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:274)
at
org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1634)
at
org.eclipse.emf.compare.ui.viewer.content.part.diff.ModelCon tentMergeDiffTab.setReflectiveInput(ModelContentMergeDiffTab .java:284)
at
org.eclipse.emf.compare.ui.viewer.content.part.ModelContentM ergeTabFolder.setInput(ModelContentMergeTabFolder.java:309)
at
org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeV iewer.updateContent(ModelContentMergeViewer.java:755)
at
org.eclipse.compare.contentmergeviewer.ContentMergeViewer.in ternalRefresh(ContentMergeViewer.java:783)
at
org.eclipse.compare.contentmergeviewer.ContentMergeViewer.in putChanged(ContentMergeViewer.java:683)
at
org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:274)
at
org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeV iewer.setInput(ModelContentMergeViewer.java:301)
at
org.eclipse.compare.CompareViewerSwitchingPane.setInput(Comp areViewerSwitchingPane.java:270)
at
org.eclipse.compare.internal.CompareContentViewerSwitchingPa ne.setInput(CompareContentViewerSwitchingPane.java:132)
at
org.eclipse.compare.CompareEditorInput.internalSetContentPan eInput(CompareEditorInput.java:817)
at
org.eclipse.compare.CompareEditorInput.access$8(CompareEdito rInput.java:815)
at
org.eclipse.compare.CompareEditorInput$11.run(CompareEditorI nput.java:755)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.compare.CompareEditorInput.feed1(CompareEditorIn put.java:749)
at
org.eclipse.compare.CompareEditorInput.feedInput(CompareEdit orInput.java:727)
at
org.eclipse.compare.CompareEditorInput.createContents(Compar eEditorInput.java:543)
at
org.eclipse.compare.internal.CompareEditor.createCompareCont rol(CompareEditor.java:449)
at
org.eclipse.compare.internal.CompareEditor.access$6(CompareE ditor.java:416)
at
org.eclipse.compare.internal.CompareEditor$3.run(CompareEdit or.java:372)
at
org.eclipse.ui.internal.UILockListener.doPendingWork(UILockL istener.java:155)
at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer. java:158)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3885)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3506)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)


Thank you,
Previous Topic:UML2Util : NPE using EMF Compare
Next Topic:how to transform the .profile.uml to .ecore files
Goto Forum:
  


Current Time: Sat Oct 25 15:20:01 GMT 2014

Powered by FUDForum. Page generated in 0.02022 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software