summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2009-07-14 09:07:20 (EDT)
committerStefan Winkler2009-07-14 09:07:20 (EDT)
commit72f24679f7083bd8be80f65496a8992b5e739ff0 (patch)
tree285e06fd30e1bee7471c61f5c300f6787c11aba2
parent05b876a3a3212a6de4d1dcfa56edcd29cbd25e85 (diff)
downloadcdo-72f24679f7083bd8be80f65496a8992b5e739ff0.zip
cdo-72f24679f7083bd8be80f65496a8992b5e739ff0.tar.gz
cdo-72f24679f7083bd8be80f65496a8992b5e739ff0.tar.bz2
[283410] Enum problems with CDOTypeImpl
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283410
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
index 0c6ed93..88d5cbb 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
@@ -457,12 +457,23 @@ public abstract class CDOTypeImpl implements CDOType
{
for (EEnumLiteral literal : ((EEnum)type).getELiterals())
{
- if (literal.getInstance() == value)
+ if (literal == value || literal.getInstance() == value)
{
return literal.getValue();
}
}
+ // EEnumLiteral[] literals = ((EEnum)type).getELiterals().toArray(
+ // new EEnumLiteral[((EEnum)type).getELiterals().size()]);
+ // for (EEnumLiteral literal : literals)
+ // {
+ // Enumerator instance = literal.getInstance();
+ // if (instance == value)
+ // {
+ // return literal.getValue();
+ // }
+ // }
+
throw new IllegalStateException(MessageFormat.format(Messages.getString("CDOTypeImpl.23"), value)); //$NON-NLS-1$
}