geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject [17/51] [abbrv] geronimo-yoko git commit: Handle java.lang.Enum itself via its own TypeDescriptor
Date Sun, 19 Feb 2017 01:49:34 GMT
Handle java.lang.Enum itself via its own TypeDescriptor


Project: http://git-wip-us.apache.org/repos/asf/geronimo-yoko/repo
Commit: http://git-wip-us.apache.org/repos/asf/geronimo-yoko/commit/5ec4f36e
Tree: http://git-wip-us.apache.org/repos/asf/geronimo-yoko/tree/5ec4f36e
Diff: http://git-wip-us.apache.org/repos/asf/geronimo-yoko/diff/5ec4f36e

Branch: refs/heads/master
Commit: 5ec4f36e828d1f7eee7c7fcd27941f84516ebd6c
Parents: 49a219e
Author: Neil GM Richards <neil_richards@uk.ibm.com>
Authored: Tue Mar 15 17:30:02 2016 +0000
Committer: Neil GM Richards <neil_richards@uk.ibm.com>
Committed: Tue Mar 15 17:30:02 2016 +0000

----------------------------------------------------------------------
 .../apache/yoko/rmi/impl/EnumDescriptor.java    | 30 ++++++++++++++++++++
 .../apache/yoko/rmi/impl/TypeRepository.java    |  4 ++-
 .../apache/yoko/rmi/impl/ValueDescriptor.java   |  4 ---
 3 files changed, 33 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/5ec4f36e/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/EnumDescriptor.java
----------------------------------------------------------------------
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;
+    }
+}

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/5ec4f36e/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeRepository.java
----------------------------------------------------------------------
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 @@ public class TypeRepository {
                     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);

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/5ec4f36e/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java
----------------------------------------------------------------------
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 @@ import sun.reflect.ReflectionFactory;
 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 @@ public class ValueDescriptor extends TypeDescriptor {
     }
 
     long getSerialVersionUID() {
-        if (_is_enum) return 0L;
         if (_serial_version_uid_field != null) {
 
             try {
@@ -176,7 +173,6 @@ public class ValueDescriptor extends TypeDescriptor {
         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);


Mime
View raw message