Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 282380

Summary: DefautProvider#getRelevantConnections may throw a NPE
Product: [Modeling] GMF-Runtime Reporter: Mariot Chauvin <mariot.chauvin>
Component: GeneralAssignee: Mariot Chauvin <mariot.chauvin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse
Version: 2.3   
Target Milestone: 2.2.1   
Hardware: All   
OS: All   
Whiteboard:

Description Mariot Chauvin CLA 2009-07-03 10:19:15 EDT
DefautProvider#getRelevantConnections contains currently the following code :

EditPart target = connectionEP.getTarget();
// check to see if the toView is in the shapesDict, if yes,
// the associated connectionView should be included on graph
if (target instanceof IBorderItemEditPart)
  target = target.getParent();
Object o = editPartToNodeDict.get(target);


If target is null, HashTable#get will throw a NullPointerException
We get a case where it occured.
Comment 1 Mariot Chauvin CLA 2009-07-03 10:53:15 EDT
I added a null check :

if (target != null) {
  Object o = editPartToNodeDict.get(target);
  if (o != null) {
    connectionsToMove.add(connectionEP);
  }
}

Committed to R2_2_maintenance and HEAD.
Comment 2 Eclipse Webmaster CLA 2010-07-19 12:27:53 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug