diff options
author | Ed Merks | 2018-12-06 10:55:42 +0000 |
---|---|---|
committer | Ed Merks | 2018-12-06 10:55:42 +0000 |
commit | 2c70efcd827adf6e2732ab4a0f75f521d2b760a9 (patch) | |
tree | 82da280ec300a2a6a89ff3889c2c564645f6e75a | |
parent | 666f438f84c97358ce33fd4c1f615212cdd419f9 (diff) | |
download | org.eclipse.emf-2c70efcd827adf6e2732ab4a0f75f521d2b760a9.tar.gz org.eclipse.emf-2c70efcd827adf6e2732ab4a0f75f521d2b760a9.tar.xz org.eclipse.emf-2c70efcd827adf6e2732ab4a0f75f521d2b760a9.zip |
4 files changed, 120 insertions, 77 deletions
diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/Class.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/Class.java index 9fc84ea1a..726173e17 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/Class.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/Class.java @@ -683,39 +683,40 @@ public class Class protected final String TEXT_664 = NL + "\t\tresult.append("; protected final String TEXT_665 = "_EFLAG_OFFSET]);"; protected final String TEXT_666 = NL + "\t\tresult.append(')');" + NL + "\t\treturn result.toString();" + NL + "\t}" + NL; - protected final String TEXT_667 = NL + "\tprotected int hash = -1;" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getHash()" + NL + "\t{" + NL + "\t\tif (hash == -1)" + NL + "\t\t{" + NL + "\t\t\t"; - protected final String TEXT_668 = " theKey = getKey();" + NL + "\t\t\thash = (theKey == null ? 0 : theKey.hashCode());" + NL + "\t\t}" + NL + "\t\treturn hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setHash(int hash)" + NL + "\t{" + NL + "\t\tthis.hash = hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_669 = " getKey()" + NL + "\t{"; - protected final String TEXT_670 = "(getTypedKey());"; - protected final String TEXT_671 = NL + "\t\treturn getTypedKey();"; - protected final String TEXT_672 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setKey("; - protected final String TEXT_673 = " key)" + NL + "\t{"; - protected final String TEXT_674 = NL + "\t\tgetTypedKey().addAll("; - protected final String TEXT_675 = "key);"; - protected final String TEXT_676 = NL + "\t\tsetTypedKey(key);"; - protected final String TEXT_677 = NL + "\t\tsetTypedKey((("; - protected final String TEXT_678 = ")key)."; - protected final String TEXT_679 = NL + "\t\tsetTypedKey(("; - protected final String TEXT_680 = ")key);"; - protected final String TEXT_681 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_682 = " getValue()" + NL + "\t{"; - protected final String TEXT_683 = "(getTypedValue());"; - protected final String TEXT_684 = NL + "\t\treturn getTypedValue();"; - protected final String TEXT_685 = " setValue("; - protected final String TEXT_686 = " value)" + NL + "\t{" + NL + "\t\t"; - protected final String TEXT_687 = " oldValue = getValue();"; - protected final String TEXT_688 = NL + "\t\tgetTypedValue().clear();" + NL + "\t\tgetTypedValue().addAll("; - protected final String TEXT_689 = "value);"; - protected final String TEXT_690 = NL + "\t\tsetTypedValue(value);"; - protected final String TEXT_691 = NL + "\t\tsetTypedValue((("; - protected final String TEXT_692 = ")value)."; - protected final String TEXT_693 = NL + "\t\tsetTypedValue(("; - protected final String TEXT_694 = ")value);"; - protected final String TEXT_695 = NL + "\t\treturn oldValue;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_696 = " getEMap()" + NL + "\t{" + NL + "\t\t"; - protected final String TEXT_697 = " container = eContainer();" + NL + "\t\treturn container == null ? null : ("; - protected final String TEXT_698 = ")container.eGet(eContainmentFeature());" + NL + "\t}" + NL; - protected final String TEXT_699 = NL + "} //"; + protected final String TEXT_667 = NL + "\tprotected int hash = -1;" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_668 = NL + "\tpublic int getHash()" + NL + "\t{" + NL + "\t\tif (hash == -1)" + NL + "\t\t{" + NL + "\t\t\t"; + protected final String TEXT_669 = " theKey = getKey();" + NL + "\t\t\thash = (theKey == null ? 0 : theKey.hashCode());" + NL + "\t\t}" + NL + "\t\treturn hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_670 = NL + "\tpublic void setHash(int hash)" + NL + "\t{" + NL + "\t\tthis.hash = hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_671 = " getKey()" + NL + "\t{"; + protected final String TEXT_672 = "(getTypedKey());"; + protected final String TEXT_673 = NL + "\t\treturn getTypedKey();"; + protected final String TEXT_674 = NL + "\tpublic void setKey("; + protected final String TEXT_675 = " key)" + NL + "\t{"; + protected final String TEXT_676 = NL + "\t\tgetTypedKey().addAll("; + protected final String TEXT_677 = "key);"; + protected final String TEXT_678 = NL + "\t\tsetTypedKey(key);"; + protected final String TEXT_679 = NL + "\t\tsetTypedKey((("; + protected final String TEXT_680 = ")key)."; + protected final String TEXT_681 = NL + "\t\tsetTypedKey(("; + protected final String TEXT_682 = ")key);"; + protected final String TEXT_683 = " getValue()" + NL + "\t{"; + protected final String TEXT_684 = "(getTypedValue());"; + protected final String TEXT_685 = NL + "\t\treturn getTypedValue();"; + protected final String TEXT_686 = " setValue("; + protected final String TEXT_687 = " value)" + NL + "\t{" + NL + "\t\t"; + protected final String TEXT_688 = " oldValue = getValue();"; + protected final String TEXT_689 = NL + "\t\tgetTypedValue().clear();" + NL + "\t\tgetTypedValue().addAll("; + protected final String TEXT_690 = "value);"; + protected final String TEXT_691 = NL + "\t\tsetTypedValue(value);"; + protected final String TEXT_692 = NL + "\t\tsetTypedValue((("; + protected final String TEXT_693 = ")value)."; + protected final String TEXT_694 = NL + "\t\tsetTypedValue(("; + protected final String TEXT_695 = ")value);"; + protected final String TEXT_696 = NL + "\t\treturn oldValue;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_697 = " getEMap()" + NL + "\t{" + NL + "\t\t"; + protected final String TEXT_698 = " container = eContainer();" + NL + "\t\treturn container == null ? null : ("; + protected final String TEXT_699 = ")container.eGet(eContainmentFeature());" + NL + "\t}" + NL; + protected final String TEXT_700 = NL + "} //"; public String generate(Object argument) { @@ -1924,7 +1925,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe if (genModel.useGenerics() && ((genFeature.isContainer() || genFeature.isResolveProxies()) && !genFeature.isListType() && genFeature.isUncheckedCast(genClass) || genFeature.isListType() && !genFeature.isFeatureMapType() && (genModel.isReflectiveDelegation() || genModel.isVirtualDelegation() || (genModel.isDynamicDelegation() && !genFeature.isVolatile())) || genFeature.isListDataType() && genFeature.hasDelegateFeature() || genFeature.isListType() && genFeature.hasSettingDelegate())) { stringBuffer.append(TEXT_73); } - if (useInterfaceOverrideAnnotation && !genClass.hasCollidingGetAccessorOperation(genFeature) && !genFeature.isSuppressedGetVisibility()) { + if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingGetAccessorOperation(genFeature) && !genFeature.isSuppressedGetVisibility()) { stringBuffer.append(TEXT_124); } stringBuffer.append(TEXT_131); @@ -2695,7 +2696,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe stringBuffer.append(genFeature.getImportedType(genClass)); stringBuffer.append(TEXT_341); } else { GenOperation setAccessorOperation = genClass.getSetAccessorOperation(genFeature); - if (useInterfaceOverrideAnnotation && !genClass.hasCollidingSetAccessorOperation(genFeature) && !genFeature.isSuppressedSetVisibility()) { + if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingSetAccessorOperation(genFeature) && !genFeature.isSuppressedSetVisibility()) { stringBuffer.append(TEXT_124); } stringBuffer.append(TEXT_159); @@ -3425,7 +3426,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe stringBuffer.append(genFeature.getAccessorName()); stringBuffer.append(TEXT_163); } else { - if (useInterfaceOverrideAnnotation && !genClass.hasCollidingUnsetAccessorOperation(genFeature) && !genFeature.isSuppressedUnsetVisibility()) { + if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingUnsetAccessorOperation(genFeature) && !genFeature.isSuppressedUnsetVisibility()) { stringBuffer.append(TEXT_124); } stringBuffer.append(TEXT_419); @@ -3842,7 +3843,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe stringBuffer.append(genFeature.getAccessorName()); stringBuffer.append(TEXT_163); } else { - if (useInterfaceOverrideAnnotation && !genClass.hasCollidingIsSetAccessorOperation(genFeature) && !genFeature.isSuppressedIsSetVisibility()) { + if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingIsSetAccessorOperation(genFeature) && !genFeature.isSuppressedIsSetVisibility()) { stringBuffer.append(TEXT_124); } stringBuffer.append(TEXT_442); @@ -4074,7 +4075,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe if (genModel.useGenerics() && !genOperation.hasBody() && !genOperation.isInvariant() && genOperation.hasInvocationDelegate() && genOperation.isUncheckedCast(genClass)) { stringBuffer.append(TEXT_73); } - if (useInterfaceOverrideAnnotation && !genOperation.isSuppressedVisibility()) { + if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genOperation.isSuppressedVisibility()) { stringBuffer.append(TEXT_124); } stringBuffer.append(TEXT_131); @@ -5302,92 +5303,116 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe stringBuffer.append(genModel.getImportedName("com.google.gwt.user.client.rpc.GwtTransient")); } stringBuffer.append(TEXT_667); - stringBuffer.append(objectType); + if (useInterfaceOverrideAnnotation) { + stringBuffer.append(TEXT_124); + } stringBuffer.append(TEXT_668); - stringBuffer.append(keyType); + stringBuffer.append(objectType); stringBuffer.append(TEXT_669); + if (useInterfaceOverrideAnnotation) { + stringBuffer.append(TEXT_124); + } + stringBuffer.append(TEXT_670); + if (useInterfaceOverrideAnnotation) { + stringBuffer.append(TEXT_124); + } + stringBuffer.append(TEXT_131); + stringBuffer.append(keyType); + stringBuffer.append(TEXT_671); if (!isJDK50 && keyFeature.isPrimitiveType()) { stringBuffer.append(TEXT_272); stringBuffer.append(keyFeature.getObjectType(genClass)); - stringBuffer.append(TEXT_670); + stringBuffer.append(TEXT_672); } else { - stringBuffer.append(TEXT_671); + stringBuffer.append(TEXT_673); } - stringBuffer.append(TEXT_672); + stringBuffer.append(TEXT_123); + if (useInterfaceOverrideAnnotation) { + stringBuffer.append(TEXT_124); + } + stringBuffer.append(TEXT_674); stringBuffer.append(keyType); - stringBuffer.append(TEXT_673); + stringBuffer.append(TEXT_675); if (keyFeature.isListType()) { - stringBuffer.append(TEXT_674); + stringBuffer.append(TEXT_676); if (!genModel.useGenerics()) { stringBuffer.append(TEXT_93); stringBuffer.append(genModel.getImportedName("java.util.Collection")); stringBuffer.append(TEXT_86); } - stringBuffer.append(TEXT_675); + stringBuffer.append(TEXT_677); } else if (isJDK50) { - stringBuffer.append(TEXT_676); + stringBuffer.append(TEXT_678); } else if (keyFeature.isPrimitiveType()) { - stringBuffer.append(TEXT_677); + stringBuffer.append(TEXT_679); stringBuffer.append(keyFeature.getObjectType(genClass)); - stringBuffer.append(TEXT_678); + stringBuffer.append(TEXT_680); stringBuffer.append(keyFeature.getPrimitiveValueFunction()); stringBuffer.append(TEXT_538); } else { - stringBuffer.append(TEXT_679); + stringBuffer.append(TEXT_681); stringBuffer.append(keyFeature.getImportedType(genClass)); - stringBuffer.append(TEXT_680); + stringBuffer.append(TEXT_682); } - stringBuffer.append(TEXT_681); + stringBuffer.append(TEXT_123); + if (useInterfaceOverrideAnnotation) { + stringBuffer.append(TEXT_124); + } + stringBuffer.append(TEXT_131); stringBuffer.append(valueType); - stringBuffer.append(TEXT_682); + stringBuffer.append(TEXT_683); if (!isJDK50 && valueFeature.isPrimitiveType()) { stringBuffer.append(TEXT_272); stringBuffer.append(valueFeature.getObjectType(genClass)); - stringBuffer.append(TEXT_683); - } else { stringBuffer.append(TEXT_684); - } - stringBuffer.append(TEXT_681); - stringBuffer.append(valueType); + } else { stringBuffer.append(TEXT_685); + } + stringBuffer.append(TEXT_123); + if (useInterfaceOverrideAnnotation) { + stringBuffer.append(TEXT_124); + } + stringBuffer.append(TEXT_131); stringBuffer.append(valueType); stringBuffer.append(TEXT_686); stringBuffer.append(valueType); stringBuffer.append(TEXT_687); - if (valueFeature.isListType()) { + stringBuffer.append(valueType); stringBuffer.append(TEXT_688); + if (valueFeature.isListType()) { + stringBuffer.append(TEXT_689); if (!genModel.useGenerics()) { stringBuffer.append(TEXT_93); stringBuffer.append(genModel.getImportedName("java.util.Collection")); stringBuffer.append(TEXT_86); } - stringBuffer.append(TEXT_689); - } else if (isJDK50) { stringBuffer.append(TEXT_690); - } else if (valueFeature.isPrimitiveType()) { + } else if (isJDK50) { stringBuffer.append(TEXT_691); - stringBuffer.append(valueFeature.getObjectType(genClass)); + } else if (valueFeature.isPrimitiveType()) { stringBuffer.append(TEXT_692); + stringBuffer.append(valueFeature.getObjectType(genClass)); + stringBuffer.append(TEXT_693); stringBuffer.append(valueFeature.getPrimitiveValueFunction()); stringBuffer.append(TEXT_538); } else { - stringBuffer.append(TEXT_693); - stringBuffer.append(valueFeature.getImportedType(genClass)); stringBuffer.append(TEXT_694); - } + stringBuffer.append(valueFeature.getImportedType(genClass)); stringBuffer.append(TEXT_695); + } + stringBuffer.append(TEXT_696); if (genModel.useGenerics()) { stringBuffer.append(TEXT_73); } stringBuffer.append(TEXT_131); stringBuffer.append(eMapType); - stringBuffer.append(TEXT_696); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_697); - stringBuffer.append(eMapType); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_698); - } + stringBuffer.append(eMapType); stringBuffer.append(TEXT_699); + } + stringBuffer.append(TEXT_700); stringBuffer.append(isInterface ? " " + genClass.getInterfaceName() : genClass.getClassName()); // TODO fix the space above genModel.emitSortedImports(); diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/FactoryClass.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/FactoryClass.java index 14b0783e8..078aaa839 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/FactoryClass.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/FactoryClass.java @@ -459,7 +459,7 @@ public class FactoryClass if (isJDK50 && genClass.hasAPIDeprecatedTag()) { stringBuffer.append(TEXT_63); } - if (useInterfaceOverrideAnnotation) { + if (useInterfaceOverrideAnnotation && !genClass.isMapEntry()) { stringBuffer.append(TEXT_40); } stringBuffer.append(TEXT_64); diff --git a/plugins/org.eclipse.emf.codegen.ecore/templates/model/Class.javajet b/plugins/org.eclipse.emf.codegen.ecore/templates/model/Class.javajet index 80606b0cd..f94bcae1c 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/templates/model/Class.javajet +++ b/plugins/org.eclipse.emf.codegen.ecore/templates/model/Class.javajet @@ -923,7 +923,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe <%if (genModel.useGenerics() && ((genFeature.isContainer() || genFeature.isResolveProxies()) && !genFeature.isListType() && genFeature.isUncheckedCast(genClass) || genFeature.isListType() && !genFeature.isFeatureMapType() && (genModel.isReflectiveDelegation() || genModel.isVirtualDelegation() || (genModel.isDynamicDelegation() && !genFeature.isVolatile())) || genFeature.isListDataType() && genFeature.hasDelegateFeature() || genFeature.isListType() && genFeature.hasSettingDelegate())) {%> @SuppressWarnings("unchecked") <%}%> - <%if (useInterfaceOverrideAnnotation && !genClass.hasCollidingGetAccessorOperation(genFeature) && !genFeature.isSuppressedGetVisibility()) {%> + <%if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingGetAccessorOperation(genFeature) && !genFeature.isSuppressedGetVisibility()) {%> @Override <%}%> public <%=genFeature.getImportedType(genClass)%> <%=genFeature.getGetAccessor()%><%if (genClass.hasCollidingGetAccessorOperation(genFeature)) {%>_<%}%>() @@ -1244,7 +1244,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe void set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType(genClass)%> value); <%} else { GenOperation setAccessorOperation = genClass.getSetAccessorOperation(genFeature);%> - <%if (useInterfaceOverrideAnnotation && !genClass.hasCollidingSetAccessorOperation(genFeature) && !genFeature.isSuppressedSetVisibility()) {%> + <%if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingSetAccessorOperation(genFeature) && !genFeature.isSuppressedSetVisibility()) {%> @Override <%}%> public void set<%=genFeature.getAccessorName()%><%if (genClass.hasCollidingSetAccessorOperation(genFeature)) {%>_<%}%>(<%=genFeature.getImportedType(genClass)%> <%=setAccessorOperation == null ? "new" + genFeature.getCapName() : setAccessorOperation.getGenParameters().get(0).getName()%>) @@ -1520,7 +1520,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe void unset<%=genFeature.getAccessorName()%>(); <%} else {%> - <%if (useInterfaceOverrideAnnotation && !genClass.hasCollidingUnsetAccessorOperation(genFeature) && !genFeature.isSuppressedUnsetVisibility()) {%> + <%if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingUnsetAccessorOperation(genFeature) && !genFeature.isSuppressedUnsetVisibility()) {%> @Override <%}%> public void unset<%=genFeature.getAccessorName()%><%if (genClass.hasCollidingUnsetAccessorOperation(genFeature)) {%>_<%}%>() @@ -1699,7 +1699,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe boolean isSet<%=genFeature.getAccessorName()%>(); <%} else {%> - <%if (useInterfaceOverrideAnnotation && !genClass.hasCollidingIsSetAccessorOperation(genFeature) && !genFeature.isSuppressedIsSetVisibility()) {%> + <%if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genClass.hasCollidingIsSetAccessorOperation(genFeature) && !genFeature.isSuppressedIsSetVisibility()) {%> @Override <%}%> public boolean isSet<%=genFeature.getAccessorName()%><%if (genClass.hasCollidingIsSetAccessorOperation(genFeature)) {%>_<%}%>() @@ -1847,7 +1847,7 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe <%if (genModel.useGenerics() && !genOperation.hasBody() && !genOperation.isInvariant() && genOperation.hasInvocationDelegate() && genOperation.isUncheckedCast(genClass)) {%> @SuppressWarnings("unchecked") <%}%> - <%if (useInterfaceOverrideAnnotation && !genOperation.isSuppressedVisibility()) {%> + <%if (useInterfaceOverrideAnnotation && !genClass.isMapEntry() && !genOperation.isSuppressedVisibility()) {%> @Override <%}%> public <%=genOperation.getTypeParameters(genClass)%><%=genOperation.getImportedType(genClass)%> <%=genOperation.getName()%>(<%=genOperation.getParameters(isImplementation, genClass)%>)<%=genOperation.getThrows(genClass)%> @@ -2628,6 +2628,9 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe * <!-- end-user-doc --> * @generated */ + <%if (useInterfaceOverrideAnnotation) {%> + @Override + <%}%> public int getHash() { if (hash == -1) @@ -2643,6 +2646,9 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe * <!-- end-user-doc --> * @generated */ + <%if (useInterfaceOverrideAnnotation) {%> + @Override + <%}%> public void setHash(int hash) { this.hash = hash; @@ -2653,6 +2659,9 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe * <!-- end-user-doc --> * @generated */ + <%if (useInterfaceOverrideAnnotation) {%> + @Override + <%}%> public <%=keyType%> getKey() { <%if (!isJDK50 && keyFeature.isPrimitiveType()) {%> @@ -2667,6 +2676,9 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe * <!-- end-user-doc --> * @generated */ + <%if (useInterfaceOverrideAnnotation) {%> + @Override + <%}%> public void setKey(<%=keyType%> key) { <%if (keyFeature.isListType()) {%> @@ -2685,6 +2697,9 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe * <!-- end-user-doc --> * @generated */ + <%if (useInterfaceOverrideAnnotation) {%> + @Override + <%}%> public <%=valueType%> getValue() { <%if (!isJDK50 && valueFeature.isPrimitiveType()) {%> @@ -2699,6 +2714,9 @@ if (index != -1) { head = typeName.substring(0, index); tail = "<code>" + CodeGe * <!-- end-user-doc --> * @generated */ + <%if (useInterfaceOverrideAnnotation) {%> + @Override + <%}%> public <%=valueType%> setValue(<%=valueType%> value) { <%=valueType%> oldValue = getValue(); diff --git a/plugins/org.eclipse.emf.codegen.ecore/templates/model/FactoryClass.javajet b/plugins/org.eclipse.emf.codegen.ecore/templates/model/FactoryClass.javajet index 5e7f18a92..24bb8c37f 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/templates/model/FactoryClass.javajet +++ b/plugins/org.eclipse.emf.codegen.ecore/templates/model/FactoryClass.javajet @@ -225,7 +225,7 @@ public interface <%=genPackage.getFactoryInterfaceName()%><%if (!genModel.isSupp <%if (isJDK50 && genClass.hasAPIDeprecatedTag()) {%> @Deprecated <%}%> -<%if (useInterfaceOverrideAnnotation) {%> +<%if (useInterfaceOverrideAnnotation && !genClass.isMapEntry()) {%> @Override <%}%> public <%=genClass.getTypeParameters()%><%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceTypeArguments()%> create<%=genClass.getName()%>() |