Bug 533934 - [SysML 1.4] RcpTT tests failing due to change in Papyrus
Oxygen 3.0

 - change default names in RcpTT tests
 - temporary fix for proposed name when creating block
 - a bunch of quality fix

Change-Id: I8a5921b8b62f0dd94f962428ad27c171cf80528a
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
diff --git a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/UpdateNestedPathConnectorEndTest.java b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/UpdateNestedPathConnectorEndTest.java
index 2984d7a..251326f 100644
--- a/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/UpdateNestedPathConnectorEndTest.java
+++ b/core/org.eclipse.papyrus.sysml14.service.types.tests/src/org/eclipse/papyrus/sysml14/service/types/tests/command/UpdateNestedPathConnectorEndTest.java
@@ -174,14 +174,14 @@
 		NestedConnectorEnd stereotypeApplication = UMLUtil.getStereotypeApplication(sourceEnd, NestedConnectorEnd.class);
 		Assert.assertTrue("The sourceEnd should have a NestedConnectorEnd applied", stereotypeApplication != null);
 		
-		UpdateNestedPathConnectorEnd createAssociationCommand_target = new UpdateNestedPathConnectorEnd("UpdateNestedPathConnectorEnd test target", p3ViewInP2, validRequest, false);
-		Assert.assertTrue("The createAssociationCommand should be executable", createAssociationCommand_target.canExecute());
+		UpdateNestedPathConnectorEnd createAssociationCommandTarget = new UpdateNestedPathConnectorEnd("UpdateNestedPathConnectorEnd test target", p3ViewInP2, validRequest, false);
+		Assert.assertTrue("The createAssociationCommand should be executable", createAssociationCommandTarget.canExecute());
 
-		InternalTransaction startTransaction_target = editingDomain.startTransaction(false, null);
-		editingDomain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(createAssociationCommand_target));
-		startTransaction_target.commit();
-		NestedConnectorEnd stereotypeApplication_target = UMLUtil.getStereotypeApplication(targetEnd, NestedConnectorEnd.class);
-		Assert.assertTrue("The targetEnd should have a NestedConnectorEnd applied", stereotypeApplication_target != null);
+		InternalTransaction startTransactionTarget = editingDomain.startTransaction(false, null);
+		editingDomain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(createAssociationCommandTarget));
+		startTransactionTarget.commit();
+		NestedConnectorEnd stereotypeApplicationTarget = UMLUtil.getStereotypeApplication(targetEnd, NestedConnectorEnd.class);
+		Assert.assertTrue("The targetEnd should have a NestedConnectorEnd applied", stereotypeApplicationTarget != null);
 	}
 
 }
diff --git a/core/org.eclipse.papyrus.sysml14.validation.tests/META-INF/MANIFEST.MF b/core/org.eclipse.papyrus.sysml14.validation.tests/META-INF/MANIFEST.MF
index fd8c8e0..9c46613 100644
--- a/core/org.eclipse.papyrus.sysml14.validation.tests/META-INF/MANIFEST.MF
+++ b/core/org.eclipse.papyrus.sysml14.validation.tests/META-INF/MANIFEST.MF
@@ -16,3 +16,4 @@
  org.eclipse.papyrus.sysml14.validation.tests.rules.portsandflows,
  org.eclipse.papyrus.sysml14.validation.tests.rules.requirements
 Automatic-Module-Name: org.eclipse.papyrus.sysml14.validation.tests
+Bundle-Vendor: %Bundle-Vendor
diff --git a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/DiscreteNoContinuousModelConstraint.java b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/DiscreteNoContinuousModelConstraint.java
index 73aa770..36488a6 100644
--- a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/DiscreteNoContinuousModelConstraint.java
+++ b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/DiscreteNoContinuousModelConstraint.java
@@ -38,27 +38,21 @@
 	 */
 	@Override
 	public IStatus validate(IValidationContext context) {
-		Discrete noBuffer = (Discrete) context.getTarget();
+		Discrete discrete = (Discrete) context.getTarget();
 
-		Parameter parameter = noBuffer.getBase_Parameter();
-		if (parameter != null) {
-			if (UMLUtil.getStereotypeApplication(parameter, Continuous.class) != null) {
-				return context.createFailureStatus(context.getTarget());
-			}
+		Parameter parameter = discrete.getBase_Parameter();
+		if (parameter != null && UMLUtil.getStereotypeApplication(parameter, Continuous.class) != null) {
+			return context.createFailureStatus(context.getTarget());
 		}
 
-		ObjectNode objectNode = noBuffer.getBase_ObjectNode();
-		if (objectNode != null) {
-			if (UMLUtil.getStereotypeApplication(objectNode, Continuous.class) != null) {
-				return context.createFailureStatus(context.getTarget());
-			}
+		ObjectNode objectNode = discrete.getBase_ObjectNode();
+		if (objectNode != null && UMLUtil.getStereotypeApplication(objectNode, Continuous.class) != null) {
+			return context.createFailureStatus(context.getTarget());
 		}
 
-		ActivityEdge activityEdge = noBuffer.getBase_ActivityEdge();
-		if (activityEdge != null) {
-			if (UMLUtil.getStereotypeApplication(activityEdge, Continuous.class) != null) {
-				return context.createFailureStatus(context.getTarget());
-			}
+		ActivityEdge activityEdge = discrete.getBase_ActivityEdge();
+		if (activityEdge != null && UMLUtil.getStereotypeApplication(activityEdge, Continuous.class) != null) {
+			return context.createFailureStatus(context.getTarget());
 		}
 
 		return context.createSuccessStatus();
diff --git a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/RateParameterIsStreamModelConstraint.java b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/RateParameterIsStreamModelConstraint.java
index d9407b4..6a237ed 100644
--- a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/RateParameterIsStreamModelConstraint.java
+++ b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/activities/RateParameterIsStreamModelConstraint.java
@@ -31,12 +31,9 @@
 	@Override
 	public IStatus validate(IValidationContext context) {
 		Rate rate = (Rate) context.getTarget();
-		Parameter parameter = rate.getBase_Parameter();
-		
-		if (parameter != null) {
-			if (!parameter.isStream()) {
-				return context.createFailureStatus(context.getTarget());
-			}
+		Parameter parameter = rate.getBase_Parameter();	
+		if (parameter != null && !parameter.isStream()) {
+			return context.createFailureStatus(context.getTarget());
 		}	
 		return context.createSuccessStatus();
 	}
diff --git a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/portsandflows/ProxyPortNotFullPortModelConstraint.java b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/portsandflows/ProxyPortNotFullPortModelConstraint.java
index 5cedb51..b12c257 100644
--- a/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/portsandflows/ProxyPortNotFullPortModelConstraint.java
+++ b/core/org.eclipse.papyrus.sysml14.validation/src/org/eclipse/papyrus/sysml14/validation/rules/portsandflows/ProxyPortNotFullPortModelConstraint.java
@@ -39,10 +39,8 @@
 	public IStatus validate(IValidationContext context) {
 		ProxyPort proxyPort = (ProxyPort) context.getTarget();
 		Port port = proxyPort.getBase_Port();
-		if (port != null) {
-			if (UMLUtil.getStereotypeApplication(port, FullPort.class) != null) {
-				return context.createFailureStatus(context.getTarget());
-			}
+		if (port != null && UMLUtil.getStereotypeApplication(port, FullPort.class) != null) {
+			return context.createFailureStatus(context.getTarget());
 		}
 		return context.createSuccessStatus();
 	}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/dialog/CreateOrSelectTypeWithNameDialog.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/dialog/CreateOrSelectTypeWithNameDialog.java
index 275c8f9..6452b08 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/dialog/CreateOrSelectTypeWithNameDialog.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/dialog/CreateOrSelectTypeWithNameDialog.java
@@ -20,6 +20,7 @@
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.gmf.runtime.emf.type.core.IElementType;
 import org.eclipse.papyrus.uml.diagram.common.dialogs.CreateOrSelectTypeDialog;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
 import org.eclipse.swt.widgets.Shell;
 
 /**
@@ -68,6 +69,16 @@
 
 	
 	/**
+	 * @see org.eclipse.papyrus.uml.diagram.common.dialogs.CreateOrSelectTypeDialog#setNewTypeName(java.lang.String)
+	 *
+	 * @param text
+	 */
+	@Override
+	protected void setNewTypeName(String text) {
+		super.setNewTypeName("nameMe"); // FIXME : temporary solution to fix regression introduced in Oxygen.3 See https://bugs.eclipse.org/bugs/show_bug.cgi?id=530155
+	}
+	
+	/**
 	 * @return the savedNewTypeNameText
 	 */
 	public String getSavedNewTypeNameText() {
@@ -91,7 +102,11 @@
 		savedNewTypeNameText = newTypeNameText.getText();
 	}
 	
-
+	/**
+	 * @return
+	 * @deprecated use getSavedNewTypeNameText
+	 */
+	@Deprecated() // use getSavedNewTypeNameText()
 	public String getSavedNewTypeName() {
 			return savedNewTypeNameText;
 	}
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/provider/SysML14ExpandViewProvider.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/provider/SysML14ExpandViewProvider.java
index d770d5a..2741b60 100755
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/provider/SysML14ExpandViewProvider.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/internal/provider/SysML14ExpandViewProvider.java
@@ -101,22 +101,25 @@
 			final String containerType = containerView.getType();
 			final List<String> possibleChildrenIDs = this.diagramExpansionRegistry.mapChildreen.get(currentDiagramType).parentChildrenRelation.get(containerType);
 
-			final List<String> supportedChildrenIDs = new ArrayList<String>();
-			for (final String currentChildId : possibleChildrenIDs) {
-				final ChildrenListRepresentation childrenListRepresentation = this.diagramExpansionRegistry.mapChildreen.get(currentDiagramType);
-				final AbstractRepresentation answer = childrenListRepresentation.IDMap.get(currentChildId);
-				if (answer instanceof Representation) {
-					ElementTypeConfiguration elementTypeConfiguration = ((Representation) answer).getGraphicalElementTypeRef();
-					List<MetamodelTypeConfiguration> res = getSupportedMetamodelTypeConfiguration(semanticAdapter, elementTypeConfiguration);
-					if (res.size() > 0) {
-						supportedChildrenIDs.add(currentChildId);
+			if (possibleChildrenIDs != null) {
+				final List<String> supportedChildrenIDs = new ArrayList<>();
+				for (final String currentChildId : possibleChildrenIDs) {
+					final ChildrenListRepresentation childrenListRepresentation = this.diagramExpansionRegistry.mapChildreen.get(currentDiagramType);
+					final AbstractRepresentation answer = childrenListRepresentation.IDMap.get(currentChildId);
+					if (answer instanceof Representation) {
+						ElementTypeConfiguration elementTypeConfiguration = ((Representation) answer).getGraphicalElementTypeRef();
+						List<MetamodelTypeConfiguration> res = getSupportedMetamodelTypeConfiguration(semanticAdapter, elementTypeConfiguration);
+						if (!res.isEmpty()) {
+							supportedChildrenIDs.add(currentChildId);
+						}
 					}
 				}
+
+				if (supportedChildrenIDs.size() == 1) {// other case not yet supported, we are waiting concrete case to continue implementationS
+					return supportedChildrenIDs.get(0);
+				}				
 			}
 
-			if (supportedChildrenIDs.size() == 1) {// other case not yet supported, we are waiting concrete case to continue implementationS
-				return supportedChildrenIDs.get(0);
-			}
 		}
 		return null;// not super because the super return a value !=null even when the element is not supported for the compartment
 	}
@@ -131,7 +134,7 @@
 	 * 		<code>true</code> if the elementTypeConfiguration is defined on a type (or a subtype) of the current element we are trying to create.
 	 */
 	private List<MetamodelTypeConfiguration> getSupportedMetamodelTypeConfiguration(final IAdaptable semanticAdapter, final ElementTypeConfiguration elementTypeConfiguration) {
-		final List<MetamodelTypeConfiguration> metamodelTypeConfiguration = new ArrayList<MetamodelTypeConfiguration>();
+		final List<MetamodelTypeConfiguration> metamodelTypeConfiguration = new ArrayList<>();
 		if (elementTypeConfiguration instanceof MetamodelTypeConfiguration) {
 			final MetamodelTypeConfiguration mtc = (MetamodelTypeConfiguration) elementTypeConfiguration;
 			final EClass metamodelEClass = mtc.getEClass();
diff --git a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/provider/AbstractParserProvider.java b/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/provider/AbstractParserProvider.java
index fabbd76..17e02a6 100644
--- a/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/provider/AbstractParserProvider.java
+++ b/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/provider/AbstractParserProvider.java
@@ -40,8 +40,6 @@
 	public boolean provides(IOperation operation) {
 		if (operation instanceof GetParserOperation) {
 			IAdaptable hint = ((GetParserOperation) operation).getHint();
-
-
 			return getParser(hint) != null;
 		}
 		return false;
diff --git a/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/constraints/HasStereotypeSysml14Constraint.java b/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/constraints/HasStereotypeSysml14Constraint.java
index 1fa4b62..1dd8220 100644
--- a/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/constraints/HasStereotypeSysml14Constraint.java
+++ b/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/constraints/HasStereotypeSysml14Constraint.java
@@ -15,6 +15,7 @@
 import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
 import org.eclipse.papyrus.sysml14.util.SysMLResource;
 import org.eclipse.papyrus.uml.properties.constraints.HasStereotypeConstraint;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
 import org.eclipse.uml2.uml.Profile;
 
 /**
@@ -34,7 +35,7 @@
 	@Override
 	public boolean match(Object selection) {
 		if (super.match(selection)){
-			EList<Profile> allAppliedProfiles = umlElement.getNearestPackage().getAllAppliedProfiles();
+			EList<Profile> allAppliedProfiles = UMLUtil.resolveUMLElement(selection).getNearestPackage().getAllAppliedProfiles();
 			for (Profile profile : allAppliedProfiles) {
 				String uri = profile.getURI();
 				if (SysMLResource.PROFILE_URI.equals(uri)){
@@ -65,9 +66,6 @@
 	 */
 	@Override
 	protected boolean equivalent(Constraint constraint) { 
-		if (super.equivalent(constraint)) {
-			return constraint instanceof HasStereotypeSysml14Constraint;
-		}
-		return false;
+		return super.equivalent(constraint) && constraint instanceof HasStereotypeSysml14Constraint;
 	}
 }
diff --git a/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/paste/PartPasteStrategy.java b/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/paste/PartPasteStrategy.java
index fa3d660..95121ba 100644
--- a/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/paste/PartPasteStrategy.java
+++ b/gui/org.eclipse.papyrus.sysml14.ui/src/org/eclipse/papyrus/sysml14/ui/paste/PartPasteStrategy.java
@@ -339,7 +339,7 @@
 		 * @param block
 		 */
 		public PartBlockAdditionalData(Classifier block) {
-			this.mapPropertyNameToAssociation = new HashMap<String, Association>();
+			this.mapPropertyNameToAssociation = new HashMap<>();
 			EList<Property> allAttributes = block.getAllAttributes();
 			for (Property property : allAttributes) {
 				Association association = property.getAssociation();
diff --git a/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/TC-AProjectCreation.test b/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/TC-AProjectCreation.test
index 94782e7..13cda26 100644
--- a/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/TC-AProjectCreation.test
+++ b/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/TC-AProjectCreation.test
@@ -6,8 +6,8 @@
 Element-Version: 3.0
 External-Reference: http://www.omg.org/spec/SysML/1.4/
 Id: _o7wVwPcTEeWxocwBxVlvGA
-Runtime-Version: 2.2.0.201706062317
-Save-Time: 7/10/17 11:03 AM
+Runtime-Version: 2.2.0.201706152316
+Save-Time: 4/23/18 4:47 PM
 Testcase-Type: ecl
 
 ------=_.description-216f885c-d591-38ce-8ea2-e4f8cb4d6ffa
@@ -99,7 +99,7 @@
     }
     with [get-diagram -index 1] {
         with [get-edit-part -name mymodel] {
-            get-edit-part -name Block2 | get-edit-part -text "Block2" | activate-direct-edit
+            get-edit-part -name Block14 | get-edit-part -text "Block14" | activate-direct-edit
             mouse-move 388 166 button1 -height 342 -width 656
             mouse-press 388 166 button1 -height 342 -width 656
         }
@@ -109,44 +109,44 @@
 }
 
 //open the model explorer
-get-view "Model Explorer" | get-tree | get-item "mymodel/«Block» Block2" | click
+get-view "Model Explorer" | get-tree | get-item "mymodel/«Block» Block14" | click
 get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name mymodel | mouse-move 103 19 -height 342 
     -width 656
 
 with [get-editor "mymodel.di"] {
     get-diagram -index 1 | get-edit-part -name mymodel | mouse-move 60 339 -height 342 -width 656
     get-tab-folder | get-tab-item "SysML 1.4 Internal Block Diagram" | click
-    with [get-diagram -index 1 | get-edit-part -name Block1] {
+    with [get-diagram -index 1 | get-edit-part -name Block13] {
         mouse-move 81 291 -height 342 -width 656
-        with [get-edit-part -name Block1] {
+        with [get-edit-part -name Block13] {
            mouse-press 78 12 button1 -height 250 -width 500
             mouse-release 78 12 button1 524288 -height 250 -width 500
         }
     }
 }
 
-with [get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block1] {
+with [get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block13] {
     mouse-move 338 305 -height 342 -width 656
     mouse-move 2 167 -height 342 -width 656
     mouse-move 4 453 -height 486 -width 656
 }
 
-with [get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block1] {
+with [get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block13] {
     drag-enter 3 306 -detail move
-    with [get-edit-part -name Block1] {
+    with [get-edit-part -name Block13] {
         drag-over 7 224 -detail copy
         get-edit-part -className ClassCompositeCompartmentEditPart | get-figure "1/0" | drag-over 84 75 -detail copy
     }
     drag-exit
-    get-edit-part -name Block1 | get-edit-part -className ClassCompositeCompartmentEditPart | get-figure "1/0" 
+    get-edit-part -name Block13 | get-edit-part -className ClassCompositeCompartmentEditPart | get-figure "1/0" 
         | drag-accept 84 75 -detail copy
 }
 get-view "Model Explorer" | get-tree | drag-set-data
-get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block1 | get-edit-part -name Block1 
+get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block13 | get-edit-part -name Block13 
     | get-edit-part -className ClassCompositeCompartmentEditPart | get-figure "1/0" | drop 84 75 -detail copy
 get-view "Model Explorer" | get-tree | drag-end -detail copy
 with [get-editor "mymodel.di"] {
-    get-diagram -index 1 | get-edit-part -name Block1 | mouse-move 653 258 -height 486 -width 656
+    get-diagram -index 1 | get-edit-part -name Block13 | mouse-move 653 258 -height 486 -width 656
     with [get-palette] {
         with [get-palette-entry Part] {
             mouse-move 49 15 button1 -height 24 -width 125
@@ -154,7 +154,7 @@
             mouse-release 49 15 button1 524288 -height 24 -width 125
         }
     }
-    with [get-diagram -index 1 | get-edit-part -name Block1 | get-edit-part -name Block1 | get-edit-part 
+    with [get-diagram -index 1 | get-edit-part -name Block13 | get-edit-part -name Block13 | get-edit-part 
         -className ClassCompositeCompartmentEditPart] {
         mouse-move 367 91 button1 -height 215 -width 500
         mouse-press 367 91 button1 -height 215 -width 500
@@ -162,19 +162,19 @@
     }
 }
 get-window -class CreateOrSelectBlockPropertyTypeDialog | get-button OK | click
-with [get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block1] {
+with [get-editor "mymodel.di" | get-diagram -index 1 | get-edit-part -name Block13] {
     mouse-move 300 366 button1 -height 486 -width 656
     mouse-press 300 366 button1 -height 486 -width 656
     mouse-release 300 366 button1 524288 -height 486 -width 656
     mouse-move 536 290 -height 486 -width 656
-    with [get-edit-part -name Block1] {
+    with [get-edit-part -name Block13] {
         mouse-move 491 247 -height 250 -width 500
         mouse-hover 491 247 -height 250 -width 500
     }
 }
 
 with [get-editor "mymodel.di"] {
-    get-diagram -index 1 | get-edit-part -name Block1 | mouse-move 616 130 -height 342 -width 662
+    get-diagram -index 1 | get-edit-part -name Block13 | mouse-move 616 130 -height 342 -width 662
     with [get-palette] {
         with [get-palette-entry Port] {
             mouse-move 54 15 button1 -height 24 -width 125
@@ -183,19 +183,19 @@
             mouse-hover 54 15 -height 24 -width 125
         }
     }
-    with [get-diagram -index 1 | get-edit-part -name Block1 | get-edit-part -name Block1 | get-edit-part 
+    with [get-diagram -index 1 | get-edit-part -name Block13 | get-edit-part -name Block13 | get-edit-part 
         -className ClassCompositeCompartmentEditPart] {
         mouse-move 196 93 -height 215 -width 500
-        with [get-edit-part -name "Attribute1" ] {
+        with [get-edit-part -name "Block1" ] {
             mouse-move 146 13 button1 -height 40 -width 149
             mouse-press 146 13 button1 -height 40 -width 149
             mouse-hover 146 13 -mask 524288 -height 40 -width 149
             mouse-release 146 13 button1 524288 -height 40 -width 149
         }
     }
-    with [get-diagram -index 1 | get-edit-part -name Block1] {
-        with [get-edit-part -name Block1 | get-edit-part -className ClassCompositeCompartmentEditPart] {
-            with [get-edit-part -name "Attribute1" | get-edit-part -name Port1] {
+    with [get-diagram -index 1 | get-edit-part -name Block13] {
+        with [get-edit-part -name Block13 | get-edit-part -className ClassCompositeCompartmentEditPart] {
+            with [get-edit-part -name "Block1" | get-edit-part -name Block1] {
                 mouse-move 9 10 button1 -height 20 -width 20
                 mouse-press 9 10 button1 -height 20 -width 20
                 mouse-move 9 11 -mask 524288 -height 20 -width 20
@@ -213,10 +213,10 @@
             mouse-hover 55 8 -height 24 -width 125
         }
     }
-    with [get-diagram -index 1 | get-edit-part -name Block1 | get-edit-part -name Block1 | get-edit-part 
+    with [get-diagram -index 1 | get-edit-part -name Block13 | get-edit-part -name Block13 | get-edit-part 
         -className ClassCompositeCompartmentEditPart] {
         mouse-move 377 89 -height 215 -width 500
-        with [get-edit-part -name Attribute1] {
+        with [get-edit-part -name Block1] {
             mouse-move 8 3 -height 40 -width 171
             mouse-hover 8 3 -height 40 -width 171
             mouse-move 8 3 button1 -height 40 -width 171
@@ -224,8 +224,8 @@
             mouse-release 8 3 button1 524288 -height 40 -width 171
         }
     }
-    with [get-diagram -index 1 | get-edit-part -name Block1] {
-        with [get-edit-part -name Block1] {
+    with [get-diagram -index 1 | get-edit-part -name Block13] {
+        with [get-edit-part -name Block13] {
             with [get-edit-part -className ClassCompositeCompartmentEditPart] {
                 mouse-move 290 53 -height 215 -width 500
                 mouse-hover 290 53 -height 215 -width 500
@@ -233,7 +233,7 @@
                 mouse-press 290 53 button1 -height 215 -width 500
                 mouse-release 290 53 button1 524288 -height 215 -width 500
                 mouse-move 200 84 -height 215 -width 500
-                with [get-edit-part -name "Attribute1"] {
+                with [get-edit-part -name "Block1"] {
                     mouse-move 56 4 button1 -height 40 -width 149
                     mouse-press 56 4 button1 -height 40 -width 149
                     mouse-hover 54 4 -height 40 -width 149
@@ -247,7 +247,7 @@
                 mouse-release 65 31 button1 524288 -height 215 -width 500
                 mouse-move 70 33 -height 215 -width 500
                 mouse-hover 70 33 -height 215 -width 500
-                with [get-edit-part -name "Attribute1"] {
+                with [get-edit-part -name "Block1"] {
                     mouse-move 24 9 button1 -height 40 -width 149
                     mouse-press 24 9 button1 -height 40 -width 149
                 }
@@ -255,7 +255,7 @@
             }
             mouse-drag 35 54 button1 524288 -height 250 -width 500
             mouse-release 35 54 button1 524288 -height 250 -width 500
-            get-edit-part -className ClassCompositeCompartmentEditPart | get-edit-part -name "Attribute1" | mouse-hover 24 9 
+            get-edit-part -className ClassCompositeCompartmentEditPart | get-edit-part -name "Block1" | mouse-hover 24 9 
                 -height 40 -width 149
         }
         mouse-move 5 123 -height 342 -width 656
@@ -268,18 +268,18 @@
             mouse-hover 72 11 -height 24 -width 125
         }
     }
-    with [get-diagram -index 1 | get-edit-part -name Block1 | get-edit-part -name Block1 | get-edit-part 
+    with [get-diagram -index 1 | get-edit-part -name Block13 | get-edit-part -name Block13 | get-edit-part 
         -className ClassCompositeCompartmentEditPart] {
         mouse-move 170 31 -height 215 -width 500
-        with [get-edit-part -name "Attribute1"] {
-            get-edit-part -name Port1 | mouse-move 13 6 -height 20 -width 20
+        with [get-edit-part -name "Block1"] {
+            get-edit-part -name Block1 | mouse-move 13 6 -height 20 -width 20
             with [get-handle ResizeHandle -index 1] {
                 mouse-move 2 5 button1 -height 7 -width 7
                 mouse-press 2 5 button1 -height 7 -width 7
             }
-            get-edit-part -name Port1 | mouse-move 7 8 -mask 524288 -height 20 -width 20
+            get-edit-part -name Block1 | mouse-move 7 8 -mask 524288 -height 20 -width 20
         }
-        with [get-edit-part -name Attribute1 | get-edit-part -name Port1] {
+        with [get-edit-part -name Block1 | get-edit-part -name Block1] {
             mouse-drag 10 12 button1 524288 -height 20 -width 20
             mouse-release 10 12 button1 524288 -height 20 -width 20
             mouse-hover 10 12 -height 20 -width 20
@@ -288,21 +288,21 @@
     }
     /*
     with [get-diagram -index 1] {
-        with [get-edit-part -name Block1 | get-edit-part -name Block1 | get-edit-part 
+        with [get-edit-part -name Block13 | get-edit-part -name Block13 | get-edit-part 
             -className ClassCompositeCompartmentEditPart] {
-            get-edit-part -name Attribute1 | get-edit-part -name Port1 | mouse-release 10 12 button1 524288 -height 20 
+            get-edit-part -name Block1 | get-edit-part -name Block1 | mouse-release 10 12 button1 524288 -height 20 
                 -width 20
             mouse-move 254 70 -height 215 -width 500
-            with [get-edit-part -name Attribute1 | get-edit-part -name Port1 | get-target-connection 0] {
+            with [get-edit-part -name Block1 | get-edit-part -name Block1 | get-target-connection 0] {
                 mouse-move 107 45 button1 -height 107 -width 182
                 mouse-press 107 45 button1 -height 107 -width 182
                 mouse-move 106 44 -mask 524288 -height 107 -width 182
             }
         }
         mouse-drag 298 147 -mask 524288 -height 342 -width 656
-        with [get-edit-part -name Block1] {
-            with [get-edit-part -name Block1 | get-edit-part -className ClassCompositeCompartmentEditPart 
-                | get-edit-part -name Attribute1 | get-edit-part -name Port1 | get-target-connection 0 
+        with [get-edit-part -name Block13] {
+            with [get-edit-part -name Block13 | get-edit-part -className ClassCompositeCompartmentEditPart 
+                | get-edit-part -name Block1 | get-edit-part -name Block1 | get-target-connection 0 
                 | get-handle BendpointMoveHandleEx] {
                 mouse-drag 6 3 button1 524288 -height 7 -width 7
                 mouse-release 6 3 button1 524288 -height 7 -width 7
@@ -315,7 +315,7 @@
 
 //Add a requirement
 with [get-editor "mymodel.di"] {
-    with [get-diagram -index 1 | get-edit-part -name Block1] {
+    with [get-diagram -index 1 | get-edit-part -name Block13] {
         mouse-move 594 106 button1 -height 342 -width 656
         mouse-press 594 106 button1 -height 342 -width 656
         mouse-release 594 106 button1 524288 -height 342 -width 656
@@ -324,7 +324,7 @@
         mouse-hover 554 102 -height 342 -width 656
         mouse-move 556 102 -height 342 -width 656
         mouse-hover 556 102 -height 342 -width 656
-        get-edit-part -name Block1 | mouse-move 490 113 -height 250 -width 500
+        get-edit-part -name Block13 | mouse-move 490 113 -height 250 -width 500
         mouse-move 478 341 -height 342 -width 656
     }
     get-tab-folder | get-tab-item "SysML 1.4 Requirement Table" | click
diff --git a/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/diagBDD/TC-BDD-DataType.test b/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/diagBDD/TC-BDD-DataType.test
index b858cb0..0b3b8fe 100644
--- a/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/diagBDD/TC-BDD-DataType.test
+++ b/releng/org.eclipse.papyrus.sysml14.rcptt.tests/testcases/diagBDD/TC-BDD-DataType.test
@@ -30,7 +30,7 @@
     get-item "BddRoot/SysML 1.4 Block Definition" | click
     get-item BddRoot | click
     select BddRoot | get-menu "SysML 1.4 Child/ValueType" | click
-    get-item "BddRoot/«ValueType» ValueType1" | drag-start 24 13
+    get-item "BddRoot/«ValueType» ValueType13" | drag-start 24 13
     get-item BddRoot | drag-enter 140 11 -detail move
     get-item BddRoot | drag-exit
 }
@@ -65,7 +65,7 @@
     }
     with [get-diagram -index 1] {
         with [get-edit-part -name BddRoot] {
-            get-edit-part -name ValueType2 | get-edit-part -text ValueType2 | activate-direct-edit
+            get-edit-part -name ValueType14 | get-edit-part -text ValueType14 | activate-direct-edit
             mouse-move 652 37 -height 342 -width 656
         }
         commit-direct-edit
@@ -75,15 +75,15 @@
 
 /*
 //Test rendering
-with [get-editor "bddModel.di" | get-diagram -index 1 | get-edit-part -name BddRoot | get-edit-part -name ValueType1] {
-    get-property text | equals "«DataType»«ValueType»ValueType1" | verify-true
+with [get-editor "bddModel.di" | get-diagram -index 1 | get-edit-part -name BddRoot | get-edit-part -name ValueType13] {
+    get-property text | equals "«DataType»«ValueType»ValueType13" | verify-true
     get-property className | equals "org.eclipse.papyrus.uml.diagram.clazz.edit.parts.DataTypeEditPart" | verify-true
     get-property "getChildren().DataTypeOperationCompartmentEditPart[3].getCompartmentName()" | equals operations 
         | verify-true
 }
 */
-with [get-editor "bddModel.di" | get-diagram -index 1 | get-edit-part -name BddRoot | get-edit-part -name ValueType2] {
-    get-property text | equals "«DataType»«ValueType»ValueType2" | verify-true
+with [get-editor "bddModel.di" | get-diagram -index 1 | get-edit-part -name BddRoot | get-edit-part -name ValueType14] {
+    get-property text | equals "«DataType»«ValueType»ValueType14" | verify-true
     get-property className | equals "org.eclipse.papyrus.uml.diagram.clazz.edit.parts.DataTypeEditPart" | verify-true
     get-property "getChildren().DataTypeOperationCompartmentEditPart[3].getCompartmentName()" | equals operations 
         | verify-true
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/manager/cell/SysMLStereotypePropertyCellManager.java b/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/manager/cell/SysMLStereotypePropertyCellManager.java
index 526cb80..f75f137 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/manager/cell/SysMLStereotypePropertyCellManager.java
+++ b/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/manager/cell/SysMLStereotypePropertyCellManager.java
@@ -46,7 +46,7 @@
 		boolean isHandled = super.handles(columnElement, rowElement, tableManager);
 		if (isHandled) {
 			Entry<EObject, String> cellDefinition = getCellDefinition(columnElement, rowElement);
-			if (cellDefinition.getKey() instanceof Port) {
+			if (cellDefinition != null && cellDefinition.getKey() instanceof Port) {
 				final String propertyQualifiedNameString = cellDefinition.getValue().substring(Constants.PROPERTY_OF_STEREOTYPE_PREFIX.length(), cellDefinition.getValue().length());
 				// We have to use the full name for Constants because of the previous one
 				isHandled = SysMLQualifiedName.STEREOTYPE_FLOWPORT_DIRECTION.equals(propertyQualifiedNameString);
@@ -83,7 +83,7 @@
 		// The list must have 2 elements (row and column elements)
 		if (objects != null && 2 == objects.size()) {
 			if (objects.get(0) instanceof EObject && objects.get(1) instanceof String) {
-					return new AbstractMap.SimpleEntry<EObject, String>((EObject) objects.get(0), (String) objects.get(1));
+					return new AbstractMap.SimpleEntry<>((EObject) objects.get(0), (String) objects.get(1));
 			}
 		}
 		return null;
diff --git a/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/provider/SysMLFlowPortDirectionLabelProvider.java b/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/provider/SysMLFlowPortDirectionLabelProvider.java
index 62f665f..26b5959 100644
--- a/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/provider/SysMLFlowPortDirectionLabelProvider.java
+++ b/table/org.eclipse.papyrus.sysml14.nattable.common/src/org/eclipse/papyrus/sysml14/nattable/common/provider/SysMLFlowPortDirectionLabelProvider.java
@@ -44,7 +44,7 @@
 	 */
 	@Override
 	public boolean accept(final Object element) {
-       		if (element instanceof LabelProviderCellContextElementWrapper) {
+       	if (element instanceof LabelProviderCellContextElementWrapper) {
 			final ILayerCell cell = ((LabelProviderCellContextElementWrapper) element);
 			final IConfigRegistry registry = ((LabelProviderCellContextElementWrapper) element).getConfigRegistry();
 			final Object columnObject = getColumnObject(cell, registry);