summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkthoms2009-02-27 06:11:44 (EST)
committerkthoms2009-02-27 06:11:44 (EST)
commit858f7f4173d53b29d493e9e391eb99eb15fb6deb (patch)
treecff98c9f007b8b62e2b6bfd00dd1e8a983320cb4
parentca99560ecaa9ae59466438ebb55419f8d4233fb9 (diff)
downloadorg.eclipse.xpand-858f7f4173d53b29d493e9e391eb99eb15fb6deb.zip
org.eclipse.xpand-858f7f4173d53b29d493e9e391eb99eb15fb6deb.tar.gz
org.eclipse.xpand-858f7f4173d53b29d493e9e391eb99eb15fb6deb.tar.bz2
getPrimitive(): avoiding NPE when argument is null
-rw-r--r--plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/UML2MetaModelBase.java27
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/UML2MetaModelBase.java b/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/UML2MetaModelBase.java
index 607e662..e8ececa 100644
--- a/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/UML2MetaModelBase.java
+++ b/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/UML2MetaModelBase.java
@@ -78,19 +78,20 @@ public abstract class UML2MetaModelBase extends EmfMetaModel {
return result;
}
- private Type getPrimitive(String typeName) {
- if (typeName.equalsIgnoreCase(UML2_STRING) || typeName.equalsIgnoreCase(UML2_STRING1)) {
- return getTypeSystem().getStringType();
- } else if (typeName.equalsIgnoreCase(UML2_BOOLEAN) || typeName.equalsIgnoreCase(UML2_BOOLEAN1)) {
- return getTypeSystem().getBooleanType();
- } else if (typeName.equalsIgnoreCase(UML2_INTEGER) || typeName.equalsIgnoreCase(UML2_UNLIMITED_NATURAL)
- || typeName.equalsIgnoreCase(UML2_INTEGER1) || typeName.equalsIgnoreCase(UML2_UNLIMITED_NATURAL1)) {
- return getTypeSystem().getIntegerType();
- } else if (typeName.equalsIgnoreCase(UML2_REAL) || typeName.equalsIgnoreCase(UML2_REAL1)) {
- return getTypeSystem().getRealType();
- }
- return null;
- }
+ private Type getPrimitive(String typeName) {
+ if (UML2_STRING.equalsIgnoreCase(typeName) || UML2_STRING1.equalsIgnoreCase(typeName)) {
+ return getTypeSystem().getStringType();
+ } else if (UML2_BOOLEAN.equalsIgnoreCase(typeName) || UML2_BOOLEAN1.equalsIgnoreCase(typeName)) {
+ return getTypeSystem().getBooleanType();
+ } else if (UML2_INTEGER.equalsIgnoreCase(typeName) || UML2_UNLIMITED_NATURAL.equalsIgnoreCase(typeName)
+ || UML2_INTEGER1.equalsIgnoreCase(typeName) || UML2_UNLIMITED_NATURAL1.equalsIgnoreCase(typeName)) {
+ return getTypeSystem().getIntegerType();
+ } else if (UML2_REAL.equalsIgnoreCase(typeName) || UML2_REAL1.equalsIgnoreCase(typeName)) {
+ return getTypeSystem().getRealType();
+ } else {
+ return null;
+ }
+ }
@Override
public void setTypeSystem(TypeSystem typeSystem) {