Handle java.lang.Enum itself via its own TypeDescriptor
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/EnumDescriptor.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/EnumDescriptor.java
new file mode 100644
index 0000000..b5e9a0b
--- /dev/null
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/EnumDescriptor.java
@@ -0,0 +1,30 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.yoko.rmi.impl;
+
+public class EnumDescriptor extends ValueDescriptor {
+ public EnumDescriptor(Class<?> type, TypeRepository repo) {
+ super(type, repo);
+ }
+
+ @Override
+ final long getSerialVersionUID() {
+ return 0L;
+ }
+}
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeRepository.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeRepository.java
index aa5f95e..33dda66 100755
--- a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeRepository.java
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeRepository.java
@@ -118,7 +118,9 @@
return new IDLEntityDescriptor(type, repo);
} else if (Throwable.class.isAssignableFrom(type)) {
return new ExceptionDescriptor(type, repo);
- } else if (Enum.class.isAssignableFrom(type) && (Enum.class != type)) {
+ } else if (Enum.class == type) {
+ return new EnumDescriptor(type, repo);
+ } else if (Enum.class.isAssignableFrom(type)) {
return new EnumSubclassDescriptor(type, repo);
} else if (type.isArray()) {
return ArrayDescriptor.get(type, repo);
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java
index 636ee91..ac5cfa4 100755
--- a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java
@@ -73,8 +73,6 @@
public class ValueDescriptor extends TypeDescriptor {
static final Logger logger = Logger.getLogger(ValueDescriptor.class.getName());
- private boolean _is_enum;
-
private boolean _is_externalizable;
private boolean _is_serializable;
@@ -145,7 +143,6 @@
}
long getSerialVersionUID() {
- if (_is_enum) return 0L;
if (_serial_version_uid_field != null) {
try {
@@ -176,7 +173,6 @@
final Class<?> type = getJavaClass();
final Class<?> superClass = type.getSuperclass();
- _is_enum = Enum.class.isAssignableFrom(type);
_is_rmi_stub = RMIStub.class.isAssignableFrom(type);
_is_externalizable = Externalizable.class.isAssignableFrom(type);
_is_serializable = Serializable.class.isAssignableFrom(type);