[558729] Backport emf fix into 2019-06
Bug 558729
Change-Id: Ic5097dfa5f42a435dfc0621a1455bedbec021396
Signed-off-by: Thomas Guiu <thomas.guiu@soyatec.com>
diff --git a/platform_specific/2019-06/org.eclipse.egf.emf.pattern/generated/org/eclipse/egf/emf/pattern/edit/ItemProvider.java b/platform_specific/2019-06/org.eclipse.egf.emf.pattern/generated/org/eclipse/egf/emf/pattern/edit/ItemProvider.java
index 6344806..9ef43c9 100644
--- a/platform_specific/2019-06/org.eclipse.egf.emf.pattern/generated/org/eclipse/egf/emf/pattern/edit/ItemProvider.java
+++ b/platform_specific/2019-06/org.eclipse.egf.emf.pattern/generated/org/eclipse/egf/emf/pattern/edit/ItemProvider.java
@@ -1,4 +1,4 @@
-//Generated with EGF 1.6.1.201902111324
+//Generated with EGF 1.6.2.qualifier
package org.eclipse.egf.emf.pattern.edit;
import org.eclipse.egf.emf.pattern.base.*;
@@ -573,8 +573,10 @@
stringBuffer.append(TEXT_23);
}
stringBuffer.append(TEXT_62);
- if (!genClass.getLabelNotifyFeatures().isEmpty() || !genClass.getContentNotifyFeatures().isEmpty()
- || !genClass.getLabelAndContentNotifyFeatures().isEmpty()) {
+ boolean hasSwitch = !genClass.getLabelNotifyFeatures().isEmpty()
+ || !genClass.getContentNotifyFeatures().isEmpty()
+ || !genClass.getLabelAndContentNotifyFeatures().isEmpty();
+ if (hasSwitch) {
stringBuffer.append(TEXT_63);
stringBuffer.append(genClass.getRawImportedInterfaceName());
stringBuffer.append(TEXT_64);
@@ -612,15 +614,15 @@
stringBuffer.append(TEXT_71);
} else { // {
stringBuffer.append(TEXT_72);
- }
+ } // }
+ }
+ stringBuffer.append(TEXT_20);
+ stringBuffer.append(hasSwitch ? indentDefaultCase : "");
+ stringBuffer.append(TEXT_73);
+ if (hasSwitch && forceDefaultCase) { // {
stringBuffer.append(TEXT_20);
stringBuffer.append(indentDefaultCase);
- stringBuffer.append(TEXT_73);
- if (forceDefaultCase) { // {
- stringBuffer.append(TEXT_20);
- stringBuffer.append(indentDefaultCase);
- stringBuffer.append(TEXT_74);
- } // }
+ stringBuffer.append(TEXT_74);
}
stringBuffer.append(TEXT_36);
if (genModel.isCreationCommands()) {
@@ -803,7 +805,7 @@
}
stringBuffer.append(TEXT_20);
{
- //<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.edit.call.ItemProvider.ItemProvider.insert" args="genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,_List:_List"%>
+ //<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.edit.call.ItemProvider.ItemProvider.insert" args="genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,_List:_List,hasSwitch:hasSwitch"%>
InternalPatternContext ictx = (InternalPatternContext) ctx;
new Node.DataLeaf(ictx.getNode(), getClass(), null, stringBuffer.toString());
@@ -817,6 +819,7 @@
callParameters.put("forceDefaultCase", forceDefaultCase);
callParameters.put("indentDefaultCase", indentDefaultCase);
callParameters.put("_List", _List);
+ callParameters.put("hasSwitch", hasSwitch);
CallHelper.executeWithParameterInjection(
"platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#_051_wGJ-Ed-FqczH3ESmRw",
new ExecutionContext((InternalPatternContext) ctx), callParameters);
diff --git a/platform_specific/2019-06/org.eclipse.egf.emf.pattern/templates/pattern._PjK4sDG0Ed-kc8dEZsdm2w/method._PjK4uTG0Ed-kc8dEZsdm2w.pt b/platform_specific/2019-06/org.eclipse.egf.emf.pattern/templates/pattern._PjK4sDG0Ed-kc8dEZsdm2w/method._PjK4uTG0Ed-kc8dEZsdm2w.pt
index a876f89..e7892d3 100644
--- a/platform_specific/2019-06/org.eclipse.egf.emf.pattern/templates/pattern._PjK4sDG0Ed-kc8dEZsdm2w/method._PjK4uTG0Ed-kc8dEZsdm2w.pt
+++ b/platform_specific/2019-06/org.eclipse.egf.emf.pattern/templates/pattern._PjK4sDG0Ed-kc8dEZsdm2w/method._PjK4uTG0Ed-kc8dEZsdm2w.pt
@@ -278,7 +278,7 @@
public void notifyChanged(Notification notification)
{
updateChildren(notification);
-<%if (!genClass.getLabelNotifyFeatures().isEmpty() || !genClass.getContentNotifyFeatures().isEmpty() || !genClass.getLabelAndContentNotifyFeatures().isEmpty()) {%>
+<%boolean hasSwitch = !genClass.getLabelNotifyFeatures().isEmpty() || !genClass.getContentNotifyFeatures().isEmpty() || !genClass.getLabelAndContentNotifyFeatures().isEmpty(); if (hasSwitch) {%>
switch (notification.getFeatureID(<%=genClass.getRawImportedInterfaceName()%>.class))
{
@@ -303,16 +303,16 @@
fireNotifyChanged(new <%=genModel.getImportedName("org.eclipse.emf.edit.provider.ViewerNotification")%>(notification, notification.getNotifier(), true, true));
return;
<%}%>
-<%if (forceDefaultCase) {%>
+ <%if (forceDefaultCase) {%>
default:
-<%} else { // {%>
+ <%} else { // {%>
}
+ <%} // }%>
<%}%>
-<%=indentDefaultCase%> super.notifyChanged(notification);
-<%if (forceDefaultCase) { // {%>
+<%=hasSwitch ? indentDefaultCase : ""%> super.notifyChanged(notification);
+<%if (hasSwitch && forceDefaultCase) { // {%>
<%=indentDefaultCase%> return;
}
-<%} // }%>
<%}%>
}
@@ -405,6 +405,6 @@
}
<%}%>
-<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.edit.call.ItemProvider.ItemProvider.insert" args="genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,_List:_List"%>
+<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.edit.call.ItemProvider.ItemProvider.insert" args="genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,_List:_List,hasSwitch:hasSwitch"%>
}
<%genModel.emitSortedImports();%>