[545578] Tweaking formatting and copyright years.
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java
index dead399..b7e4081 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/PackageOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2018 IBM Corporation, Embarcadero Technologies, CEA, and others.
+ * Copyright (c) 2005, 2019 IBM Corporation, Embarcadero Technologies, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
@@ -44,7 +44,6 @@
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.EStructuralFeature.Setting;
import org.eclipse.emf.ecore.resource.Resource;
@@ -304,8 +303,8 @@
EAttribute targetEAttribute = (EAttribute) getTarget(eAttribute);
if (targetEAttribute != null && targetEAttribute.isChangeable()) {
- EEnum targetEEnum = UMLUtil.getEnumType(targetEAttribute
- .getEAttributeType());
+ EEnum targetEEnum = UMLUtil
+ .getEnumType(targetEAttribute.getEAttributeType());
if (targetEAttribute.isMany()) {
@SuppressWarnings("unchecked")
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
index 667f121..a0162d0 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
@@ -13879,15 +13879,16 @@
* Test if the given {@link EClassifier} represents an Enum Type.
*
* @param classifier
- * The Classifier
- * @return
- * <code>true</code> if this {@link EClassifier} is an Enum Type, <code>false</code> otherwise
+ * The Classifier
+ * @return <code>true</code> if this {@link EClassifier} is an Enum Type,
+ * <code>false</code> otherwise
*
* @see ExtendedMetaData#getBaseType
*
* @since 5.6
*/
public static boolean isEnumType(EClassifier classifier) {
+
if (classifier instanceof EEnum) {
return true;
}
@@ -13900,26 +13901,31 @@
}
/**
- * If the given {@link EClassifier} represents an Enum Type, return
- * the corresponding {@link EEnum}.
+ * If the given {@link EClassifier} represents an Enum Type, return the
+ * corresponding {@link EEnum}.
*
* @param classifier
- * The Classifier
- * @return
- * The {@link EEnum} represented by this {@link EClassifier}, or <code>null</code>
- * if this classifier doesn't represent an {@link EEnum}
+ * The Classifier
+ * @return The {@link EEnum} represented by this {@link EClassifier}, or
+ * <code>null</code> if this classifier doesn't represent an
+ * {@link EEnum}
*
* @see ExtendedMetaData#getBaseType
*
* @since 5.6
*/
public static EEnum getEnumType(EClassifier eType) {
+
if (eType instanceof EEnum) { // Standard Enums
return (EEnum) eType;
} else if (eType instanceof EDataType) { // Optional Enums
EDataType implType = (EDataType) eType;
- EDataType baseType = ExtendedMetaData.INSTANCE.getBaseType(implType);
- return baseType instanceof EEnum ? (EEnum) baseType : null;
+ EDataType baseType = ExtendedMetaData.INSTANCE
+ .getBaseType(implType);
+
+ return baseType instanceof EEnum
+ ? (EEnum) baseType
+ : null;
}
return null;