Skip to content

Commit

Permalink
[545578] Tweaking formatting and copyright years.
Browse files Browse the repository at this point in the history
  • Loading branch information
khussey committed Mar 25, 2019
1 parent fecdc66 commit 3a6c5c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -304,8 +303,8 @@ protected void copyEEnumAttribute(EAttribute eAttribute,
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13879,15 +13879,16 @@ public static boolean isUnlimitedNatural(Type type) {
* 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;
}
Expand All @@ -13900,26 +13901,31 @@ public static boolean isEnumType(EClassifier classifier) {
}

/**
* 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;
Expand Down

0 comments on commit 3a6c5c6

Please sign in to comment.