diff options
author | Ed Merks | 2019-07-04 06:32:08 +0000 |
---|---|---|
committer | Ed Merks | 2019-07-04 06:32:08 +0000 |
commit | db0fd252c00b047bf12b822727904932de316c30 (patch) | |
tree | f1c57d023f5441beb48fb5dfd6d807642c3a3cd4 | |
parent | 82914dd6959d3a1f973bc04359bc9c4329ac2b60 (diff) | |
download | org.eclipse.emf-db0fd252c00b047bf12b822727904932de316c30.tar.gz org.eclipse.emf-db0fd252c00b047bf12b822727904932de316c30.tar.xz org.eclipse.emf-db0fd252c00b047bf12b822727904932de316c30.zip |
[548957] Regression in generation of ItemProvider.notifyChanged
2 files changed, 10 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java index 7e055d794..75a155e99 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java @@ -752,7 +752,7 @@ public class ItemProvider stringBuffer.append(TEXT_24); } stringBuffer.append(TEXT_139); - 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_140); stringBuffer.append(genClass.getRawImportedInterfaceName()); stringBuffer.append(TEXT_141); @@ -790,15 +790,15 @@ public class ItemProvider stringBuffer.append(TEXT_148); } else { // { stringBuffer.append(TEXT_149); + } // } } stringBuffer.append(TEXT_21); - stringBuffer.append(indentDefaultCase); + stringBuffer.append(hasSwitch ? indentDefaultCase : ""); stringBuffer.append(TEXT_150); - if (forceDefaultCase) { // { + if (hasSwitch && forceDefaultCase) { // { stringBuffer.append(TEXT_21); stringBuffer.append(indentDefaultCase); stringBuffer.append(TEXT_151); - } // } } stringBuffer.append(TEXT_61); if (genModel.isCreationCommands()) { diff --git a/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet b/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet index f00ad41e0..38ac89946 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet +++ b/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet @@ -424,7 +424,7 @@ public class <%=genClass.getProviderClassName()%> <%if (genClass.getProviderImpl 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)) { @@ -449,16 +449,16 @@ public class <%=genClass.getProviderClassName()%> <%if (genClass.getProviderImpl 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; } -<%} // }%> <%}%> } |