Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » NPE on selecting 2 eobjects from 2 projects (NPE on selecting 2 eobjects from 2 projects )
NPE on selecting 2 eobjects from 2 projects [message #1725410] Thu, 03 March 2016 10:52 Go to next message
Babu M is currently offline Babu MFriend
Messages: 20
Registered: February 2012
Junior Member
Just select 2 eobjects from 2 projects, a nullpointer exception throws.

The null pointer exception is coming.
{{{
java.lang.NullPointerException
at org.eclipse.emf.edit.command.RemoveCommand.create(RemoveCommand.java:93)
at org.eclipse.emf.edit.command.RemoveCommand.create(RemoveCommand.java:85)
at org.eclipse.emf.edit.command.CutToClipboardCommand.create(CutToClipboardCommand.java:70)
at org.eclipse.emf.edit.ui.action.CutAction.createCommand(CutAction.java:44)
}}}



I see a problem in a file i.e. CutToClipboardCommand.create method and line no:54.

org.eclipse.emf.edit.source_2.10.1.v20150123-0452.jar
Appears like this is a bug. If so, is it already fixed?

if (domain == null) {
return new CutToClipboardCommand(domain, RemoveCommand.create(domain, owner, feature, value));

-Hari
Re: NPE on selecting 2 eobjects from 2 projects [message #1725411 is a reply to message #1725410] Thu, 03 March 2016 10:54 Go to previous messageGo to next message
Babu M is currently offline Babu MFriend
Messages: 20
Registered: February 2012
Junior Member
I think
if (domain == null) suppose to be if (domain != null)
Re: NPE on selecting 2 eobjects from 2 projects [message #1725425 is a reply to message #1725411] Thu, 03 March 2016 12:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Given the else branch does domain.createCommand it's clearly not just an
issue of reversing the test. More an issue with RemoveCommand not be
tolerant of a null domain. It's not a well tested code path. More
likely you should focus on why your domain is null in the first place.
After all, without an editing domain there won't be a command stack and
there won't be support for undo/redo...

On 03.03.2016 11:54, Babu M wrote:
> I think if (domain == null) suppose to be if (domain != null)


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Feature 'xmi' not found exception
Next Topic:UnsupportedOperationException from Model and UMLPackage
Goto Forum:
  


Current Time: Sat Apr 27 02:44:08 GMT 2024

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

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

Back to the top