Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Recent addIfPossible
Recent addIfPossible [message #768299] Mon, 19 December 2011 16:54 Go to next message
Rhett Hudson is currently offline Rhett Hudson
Messages: 43
Registered: September 2010
Member
After my recent upgrade to 0.9+ Graphiti I've noted an issue with a method call implemented by AbstractFeatureProvider's addIfPossible() method. Specifically, it always returns null. The local variable used as the return value is initialized to null and no other assignment is ever made to it.

In the Chess example, the CreateChessMoveFeature's create() method has a nearly identical line to the one I use.

  // Add the connection to the diagram
  newConnection = (Connection) getFeatureProvider().addIfPossible(addContext);


It returns the value without dereferencing it directly. My codes does, which is why I got an immediate NullPointerException.

Is this expected behavior? Or should I log a bug against it?
Re: Recent addIfPossible [message #768635 is a reply to message #768299] Tue, 20 December 2011 09:06 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1590
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Rhett,
this appears to be a bug. Would you please open a bugzilla?

Thanks,
Michael
Re: Recent addIfPossible [message #768686 is a reply to message #768635] Tue, 20 December 2011 10:55 Go to previous message
Rhett Hudson is currently offline Rhett Hudson
Messages: 43
Registered: September 2010
Member
Bug 367204
Previous Topic:Difference between Add and Create Feature
Next Topic:Collapse Feature: how to hide an element?
Goto Forum:
  


Current Time: Fri Aug 29 10:20:49 EDT 2014

Powered by FUDForum. Page generated in 0.03336 seconds