geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject [25/51] [abbrv] geronimo-yoko git commit: Further rmi-impl refactoring
Date Sun, 19 Feb 2017 01:49:42 GMT
http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/431478f4/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
----------------------------------------------------------------------
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
index a30e822..f51ee0b 100755
--- a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/SimpleDescriptor.java
@@ -18,6 +18,8 @@
 
 package org.apache.yoko.rmi.impl;
 
+import org.omg.CORBA.TypeCode;
+
 abstract class SimpleDescriptor extends TypeDescriptor {
     private final String idl_name;
     SimpleDescriptor(Class type, TypeRepository repository, String idl_name,
@@ -30,34 +32,37 @@ abstract class SimpleDescriptor extends TypeDescriptor {
     }
 
     @Override
-    protected String genIDLName() {
+    protected final String genIDLName() {
         return idl_name;
     }
 
     @Override
-    protected String genPackageName() {
+    protected final String genPackageName() {
         return "";
     }
 
     @Override
-    protected String genTypeName() {
+    protected final String genTypeName() {
         return idl_name;
     }
 
-    org.omg.CORBA.TypeCode getTypeCode() {
+    @Override
+    protected final TypeCode genTypeCode() {
         return _type_code;
     }
 
+    @Override
     boolean copyInStub() {
         return false;
     }
 
+    @Override
     public boolean copyBetweenStates() {
         return false;
     }
 
+    @Override
     public boolean copyWithinState() {
         return false;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/431478f4/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
----------------------------------------------------------------------
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
index 9d5c38b..f459794 100755
--- a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/StringDescriptor.java
@@ -18,16 +18,25 @@
 
 package org.apache.yoko.rmi.impl;
 
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.WStringValueHelper;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+import java.io.Serializable;
+
 class StringDescriptor extends ValueDescriptor {
-    public String getIDLName() {
-        return "CORBA_WStringValue";
-    }
-    
     StringDescriptor(TypeRepository repository) {
         super(String.class, repository);
     }
 
     @Override
+    protected final String genIDLName() {
+        return "CORBA_WStringValue";
+    }
+
+    @Override
     protected String genPackageName() {
         return "CORBA";
     }
@@ -38,30 +47,28 @@ class StringDescriptor extends ValueDescriptor {
     }
 
     /** Read an instance of this value from a CDR stream */
-    public Object read(org.omg.CORBA.portable.InputStream in) {
-        return org.omg.CORBA.WStringValueHelper.read(in);
+    @Override
+    public Object read(InputStream in) {
+        return WStringValueHelper.read(in);
     }
 
     /** Write an instance of this value to a CDR stream */
-    public void write(org.omg.CORBA.portable.OutputStream out, Object value) {
-        org.omg.CORBA.WStringValueHelper.write(out, (String) value);
-    }
-
-    public void writeValue(org.omg.CORBA.portable.OutputStream out,
-            java.io.Serializable value) {
-        throw new org.omg.CORBA.MARSHAL("internal error");
+    @Override
+    public void write(OutputStream out, Object value) {
+        WStringValueHelper.write(out, (String) value);
     }
 
-    public java.io.Serializable readValue(
-            org.omg.CORBA.portable.InputStream in, java.io.Serializable value,
-            java.util.Map offsetMap) {
-        throw new org.omg.CORBA.MARSHAL("internal error");
+    @Override
+    public void writeValue(OutputStream out, Serializable value) {
+        throw new MARSHAL("internal error");
     }
 
-    org.omg.CORBA.TypeCode getTypeCode() {
-        return org.omg.CORBA.WStringValueHelper.type();
+    @Override
+    protected final TypeCode genTypeCode() {
+        return WStringValueHelper.type();
     }
 
+    @Override
     Object copyObject(Object value, CopyState state) {
         return value;
     }

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/431478f4/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java
----------------------------------------------------------------------
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java
index 33730f3..3bbabf2 100755
--- a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/TypeDescriptor.java
@@ -18,43 +18,51 @@
 
 package org.apache.yoko.rmi.impl;
 
-import java.io.IOException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+import java.io.PrintWriter;
+import java.rmi.Remote;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import java.util.logging.Logger;
 
-import org.omg.CORBA.portable.InputStream;
-
 abstract class TypeDescriptor extends ModelElement {
     static Logger logger = Logger.getLogger(TypeDescriptor.class.getName());
 
-    final Class _java_class;
-
-    private volatile String _repid;
-
-    protected RemoteInterfaceDescriptor remoteDescriptor;
+    final Class type;
 
-    private FullKey _key;
+    private volatile String _repid = null;
 
-    private String package_name;    // the package name qualifier (if any)
-    public String getPackageName() {
-        checkInit();
-        return package_name;
+    private volatile String packageName = null;    // the package name qualifier (if any)
+    protected String genPackageName() {
+        int idx = java_name.lastIndexOf('.');
+        return ((idx < 0) ? "" : java_name.substring(0, idx));
+    }
+    public final String getPackageName() {
+        if (null == packageName) packageName = genPackageName();
+        return packageName;
     }
 
-    private String type_name;       // the simple type name (minus package, if any)
-    public String getTypeName() {
-        checkInit();
-        return type_name;
+    private volatile String typeName = null;       // the simple type name (minus package,
if any)
+    protected String genTypeName() {
+        int idx = java_name.lastIndexOf('.');
+        return ((idx < 0) ? java_name : java_name.substring(idx + 1));
+    }
+    public final String getTypeName() {
+        if (null == typeName) typeName = genTypeName();
+        return typeName;
     }
 
+    private volatile FullKey key = null;
+    private FullKey genKey() {
+        return new FullKey(getRepositoryID(), type);
+    }
     public final FullKey getKey() {
-        if (null == _key) {
-            _key = new FullKey(getRepositoryID(), _java_class);
-        }
-        return _key;
+        if (null == key) key = genKey();
+        return key;
     }
 
     public static class SimpleKey {
@@ -109,30 +117,13 @@ abstract class TypeDescriptor extends ModelElement {
     @Override
     public String toString() {
         return String.format("%s{class=\"%s\",repId=\"%s\"}",
-                this.getClass().getName(), _java_class,
+                this.getClass().getName(), type,
                 getRepositoryID());
     }
 
     protected TypeDescriptor(Class type, TypeRepository repository) {
         super(repository, type.getName());
-        _java_class = type;
-    }
-
-    @Override
-    protected void init() {
-        package_name = genPackageName();
-        type_name = genTypeName();
-        super.init();
-    }
-
-    protected String genPackageName() {
-        int idx = java_name.lastIndexOf('.');
-        return ((idx < 0) ? "" : java_name.substring(0, idx));
-    }
-
-    protected String genTypeName() {
-        int idx = java_name.lastIndexOf('.');
-        return ((idx < 0) ? java_name : java_name.substring(idx + 1));
+        this.type = type;
     }
 
     @Override
@@ -141,61 +132,34 @@ abstract class TypeDescriptor extends ModelElement {
     }
 
     protected String genRepId() {
-        return String.format("RMI:%s:%016X", _java_class.getName(), 0);
+        return String.format("RMI:%s:%016X", type.getName(), 0);
     }
-
     public final String getRepositoryID() {
         if (_repid == null) _repid = genRepId();
         return _repid;
     }
 
-    RemoteInterfaceDescriptor getRemoteInterface() {
-        return remoteDescriptor;
+    private volatile RemoteInterfaceDescriptor remoteInterface = null;
+    protected RemoteInterfaceDescriptor genRemoteInterface() {
+        throw new UnsupportedOperationException("class " + type + " does not implement "
+ Remote.class.getName());
     }
-
-    void setRemoteInterface(RemoteInterfaceDescriptor desc) {
-        remoteDescriptor = desc;
+    final RemoteInterfaceDescriptor getRemoteInterface() {
+        if (null == remoteInterface) remoteInterface = genRemoteInterface();
+        return remoteInterface;
     }
 
+
+
     /** Read an instance of this value from a CDR stream */
-    public abstract Object read(org.omg.CORBA.portable.InputStream in);
+    public abstract Object read(InputStream in);
 
     /** Write an instance of this value to a CDR stream */
-    public abstract void write(org.omg.CORBA.portable.OutputStream out,
-            Object val);
+    public abstract void write(OutputStream out, Object val);
 
     public boolean isCustomMarshalled() {
         return false;
     }
 
-    static class WrappedIOException extends RuntimeException {
-        IOException wrapped;
-
-        WrappedIOException(IOException ex) {
-            super("wrapped IO exception");
-            this.wrapped = ex;
-        }
-    }
-
-    CorbaObjectReader makeCorbaObjectReader(final InputStream in,
-            final Map offsetMap, final java.io.Serializable obj)
-            throws IOException {
-        try {
-            return (CorbaObjectReader) AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run() {
-                            try {
-                                return new CorbaObjectReader(in, offsetMap, obj);
-                            } catch (IOException ex) {
-                                throw new WrappedIOException(ex);
-                            }
-                        }
-                    });
-        } catch (WrappedIOException ex) {
-            throw ex.wrapped;
-        }
-    }
-
     String makeSignature(Class type) {
         if (type.isPrimitive()) {
 
@@ -242,15 +206,20 @@ abstract class TypeDescriptor extends ModelElement {
         return 0L;
     }
 
-    protected org.omg.CORBA.TypeCode _type_code = null;
+    protected TypeCode _type_code = null;
 
-    abstract org.omg.CORBA.TypeCode getTypeCode();
+    private volatile TypeCode typeCode = null;
+    protected abstract TypeCode genTypeCode();
+    final TypeCode getTypeCode() {
+        if (null == typeCode) typeCode = genTypeCode();
+        return typeCode;
+    }
 
     Object copyObject(Object value, CopyState state) {
         throw new InternalError("cannot copy " + value.getClass().getName());
     }
 
-    void writeMarshalValue(java.io.PrintWriter pw, String outName,
+    void writeMarshalValue(PrintWriter pw, String outName,
             String paramName) {
         pw.print(outName);
         pw.print('.');
@@ -261,7 +230,7 @@ abstract class TypeDescriptor extends ModelElement {
         pw.print(')');
     }
 
-    void writeUnmarshalValue(java.io.PrintWriter pw, String inName) {
+    void writeUnmarshalValue(PrintWriter pw, String inName) {
         pw.print(inName);
         pw.print('.');
         pw.print("read_");
@@ -270,7 +239,7 @@ abstract class TypeDescriptor extends ModelElement {
         pw.print(')');
     }
 
-    void addDependencies(java.util.Set<Class<?>> classes) {
+    void addDependencies(Set<Class<?>> classes) {
         return;
     }
 
@@ -278,7 +247,7 @@ abstract class TypeDescriptor extends ModelElement {
         return true;
     }
 
-    void print(java.io.PrintWriter pw, java.util.Map<Object,Integer> recurse, Object
val) {
+    void print(PrintWriter pw, Map<Object,Integer> recurse, Object val) {
         if (val == null) {
             pw.print("null");
         }
@@ -288,15 +257,11 @@ abstract class TypeDescriptor extends ModelElement {
             pw.print("^" + old);
         } else {
             Integer key = new Integer(System.identityHashCode(val));
-            pw.println(_java_class.getName() + "@"
+            pw.println(type.getName() + "@"
                     + Integer.toHexString(key.intValue()));
         }
     }
 
-    synchronized TypeDescriptor getSelf() {
-        return this;
-    }
-
     /**
      * Method copyBetweenStates.
      * 

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/431478f4/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 6ad6894..1ba4611 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
@@ -125,15 +125,15 @@ public class TypeRepository {
                     return ((enumType == type) ? new EnumSubclassDescriptor(type, repo) :
get(enumType));
                 } else if (type.isArray()) {
                     return ArrayDescriptor.get(type, repo);
-                } else if (!type.isInterface()
-                        && Serializable.class.isAssignableFrom(type)) {
-                    return new ValueDescriptor(type, repo);
                 } else if (Remote.class.isAssignableFrom(type)) {
                     if (type.isInterface()) {
                         return new RemoteInterfaceDescriptor(type, repo);
                     } else {
                         return new RemoteClassDescriptor(type, repo);
                     }
+                } else if (!type.isInterface()
+                && Serializable.class.isAssignableFrom(type)) {
+                    return new ValueDescriptor(type, repo);
                 } else if (Object.class.isAssignableFrom(type)) {
                     if (isAbstractInterface(type)) {
                         logger.finer("encoding " + type + " as abstract interface");
@@ -267,33 +267,8 @@ public class TypeRepository {
         return getDescriptor(type).getRepositoryID();
     }
 
-    public RemoteInterfaceDescriptor getRemoteDescriptor(Class<?> type) {
-        TypeDescriptor td = getDescriptor(type);
-        RemoteInterfaceDescriptor result = td.getRemoteInterface();
-
-        if (result != null) {
-            return result;
-        }
-
-        RemoteDescriptor desc;
-
-        if (java.rmi.Remote.class.isAssignableFrom(type)) {
-            if (type.isInterface()) {
-                desc = new RemoteInterfaceDescriptor(type, this);
-            } else {
-                desc = new RemoteClassDescriptor(type, this);
-            }
-
-            desc.init();
-        } else {
-            throw new IllegalArgumentException("class " + type.toString()
-                    + " does not implement" + " java.rmi.Remote");
-        }
-
-        result = desc.getRemoteInterface();
-        td.setRemoteInterface(result);
-
-        return result;
+    public RemoteInterfaceDescriptor getRemoteInterface(Class<?> type) {
+        return getDescriptor(type).getRemoteInterface();
     }
 
     public TypeDescriptor getDescriptor(Class<?> type) {

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/431478f4/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/UtilImpl.java
----------------------------------------------------------------------
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/UtilImpl.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/UtilImpl.java
index 6343381..8fe5335 100755
--- a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/UtilImpl.java
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/UtilImpl.java
@@ -715,7 +715,7 @@ public class UtilImpl implements UtilDelegate {
     static Object copyRMIStub(RMIStub stub) throws RemoteException {
         ClassLoader loader = getContextClassLoader();
 
-        if (getClassLoader(stub._descriptor._java_class) == loader) {
+        if (getClassLoader(stub._descriptor.type) == loader) {
             return stub;
         }
 
@@ -724,7 +724,7 @@ public class UtilImpl implements UtilDelegate {
         Class<?> targetClass;
 
         try {
-            targetClass = Util.loadClass(desc._java_class.getName(), stub
+            targetClass = Util.loadClass(desc.type.getName(), stub
                     ._get_codebase(), loader);
         } catch (ClassNotFoundException ex) {
             logger.log(Level.FINER, "copyRMIStub exception (current loader is: " + loader

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/431478f4/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 65e6465..0d2a3e8 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
@@ -114,7 +114,7 @@ class ValueDescriptor extends TypeDescriptor {
 
     @Override
     protected String genRepId() {
-        return String.format("RMI:%s:%016X:%016X", StringUtil.convertToValidIDLNames(_java_class.getName()),
+        return String.format("RMI:%s:%016X:%016X", StringUtil.convertToValidIDLNames(type.getName()),
                 _hash_code, getSerialVersionUID());
     }
 
@@ -136,7 +136,7 @@ class ValueDescriptor extends TypeDescriptor {
                 // skip //
             }
         }
-        ObjectStreamClass serialForm = ObjectStreamClass.lookup(_java_class);
+        ObjectStreamClass serialForm = ObjectStreamClass.lookup(type);
 
         return (serialForm != null) ? serialForm.getSerialVersionUID() : 0L;
     }
@@ -156,7 +156,6 @@ class ValueDescriptor extends TypeDescriptor {
     }
 
     private void init0() {
-        final Class<?> type = _java_class;
         final Class<?> superClass = type.getSuperclass();
 
         _is_rmi_stub = RMIStub.class.isAssignableFrom(type);
@@ -174,7 +173,7 @@ class ValueDescriptor extends TypeDescriptor {
 
         }
 
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
 
                 for (Class<?> curr = type; curr != null; curr = curr.getSuperclass())
{
@@ -222,7 +221,7 @@ class ValueDescriptor extends TypeDescriptor {
                 // validate readObject
                 //
                 if ((_write_object_method == null) || !Modifier.isPrivate(_write_object_method.getModifiers())
-                        || Modifier.isStatic(_write_object_method.getModifiers()) || (_write_object_method.getDeclaringClass()
!= _java_class)) {
+                        || Modifier.isStatic(_write_object_method.getModifiers()) || (_write_object_method.getDeclaringClass()
!= type)) {
 
                     _write_object_method = null;
 
@@ -492,7 +491,7 @@ class ValueDescriptor extends TypeDescriptor {
     }
 
     protected void defaultWriteValue(ObjectWriter writer, Serializable val) throws IOException
{
-        logger.finer("writing fields for " + _java_class);
+        logger.finer("writing fields for " + type);
         FieldDescriptor[] fields = _fields;
 
         if (fields == null) {
@@ -549,7 +548,7 @@ class ValueDescriptor extends TypeDescriptor {
                 throw (UnknownException) new UnknownException(ex.getTargetException()).initCause(ex.getTargetException());
 
             } catch (NullPointerException ex) {
-                logger.log(Level.WARNING, "unable to create instance of " + _java_class.getName(),
ex);
+                logger.log(Level.WARNING, "unable to create instance of " + type.getName(),
ex);
                 logger.warning("constructor => " + _constructor);
 
                 throw ex;
@@ -602,7 +601,7 @@ class ValueDescriptor extends TypeDescriptor {
             int key = System.identityHashCode(val);
             recurse.put(val, key);
 
-            pw.println(_java_class.getName() + "@" + Integer.toHexString(key) + "[");
+            pw.println(type.getName() + "@" + Integer.toHexString(key) + "[");
 
             printFields(pw, recurse, val);
 
@@ -638,7 +637,7 @@ class ValueDescriptor extends TypeDescriptor {
             return;
         }
 
-        logger.fine("reading fields for " + _java_class.getName());
+        logger.fine("reading fields for " + type.getName());
 
         for (FieldDescriptor _field : _fields) {
 
@@ -661,7 +660,7 @@ class ValueDescriptor extends TypeDescriptor {
             return Collections.EMPTY_MAP;
         }
 
-        logger.finer("reading fields for " + _java_class.getName());
+        logger.finer("reading fields for " + type.getName());
 
         Map map = new HashMap();
 
@@ -680,7 +679,7 @@ class ValueDescriptor extends TypeDescriptor {
             return;
         }
 
-        logger.finer("writing fields for " + _java_class.getName());
+        logger.finer("writing fields for " + type.getName());
 
         for (FieldDescriptor _field : _fields) {
 
@@ -748,7 +747,7 @@ class ValueDescriptor extends TypeDescriptor {
     }
 
     protected long computeHashCode() {
-        Class type = _java_class;
+        Class type = this.type;
 
         if (_is_externalizable) {
             return 1L;
@@ -837,26 +836,24 @@ class ValueDescriptor extends TypeDescriptor {
         return _value_members;
     }
 
-    TypeCode getTypeCode() {
-        if (_type_code != null)
-            return _type_code;
-
+    @Override
+    protected TypeCode genTypeCode() {
         ORB orb = ORB.init();
-        _type_code = orb.create_recursive_tc(getRepositoryID());
+        TypeCode typeCode = orb.create_recursive_tc(getRepositoryID());
 
         TypeCode _base = ((_super_descriptor == null) ? null : _super_descriptor.getTypeCode());
 
-        Class javaClass = _java_class;
+        Class javaClass = type;
         if (javaClass.isArray()) {
             TypeDescriptor desc = repo.getDescriptor(javaClass.getComponentType());
-            _type_code = desc.getTypeCode();
-            _type_code = orb.create_sequence_tc(0, _type_code);
-            _type_code = orb.create_value_box_tc(getRepositoryID(), "Sequence", _type_code);
+            typeCode = desc.getTypeCode();
+            typeCode = orb.create_sequence_tc(0, typeCode);
+            typeCode = orb.create_value_box_tc(getRepositoryID(), "Sequence", typeCode);
         } else {
-            _type_code = orb.create_value_tc(getRepositoryID(), javaClass.getSimpleName(),
VM_NONE.value, _base, getValueMembers());
+            typeCode = orb.create_value_tc(getRepositoryID(), javaClass.getSimpleName(),
VM_NONE.value, _base, getValueMembers());
         }
 
-        return _type_code;
+        return typeCode;
     }
 
     private static final OperationDescription[] ZERO_OPERATIONS = {};
@@ -866,7 +863,7 @@ class ValueDescriptor extends TypeDescriptor {
     
     FullValueDescription getFullValueDescription() {
         FullValueDescription fvd = new FullValueDescription();
-        fvd.name = _java_class.getName();
+        fvd.name = type.getName();
         fvd.id = getRepositoryID();
         fvd.is_abstract = false;
         fvd.is_custom = isCustomMarshalled();
@@ -902,7 +899,7 @@ class ValueDescriptor extends TypeDescriptor {
         }
 
         ObjectDeserializer(FullValueDescription desc, RunTime runtime) throws IOException
{
-            Class myClass = _java_class;
+            Class myClass = type;
             ValueMember[] members = desc.members;
             fields = new FieldDescriptor[members.length];
             for (int i = 0; i < members.length; i++) {
@@ -962,7 +959,7 @@ class ValueDescriptor extends TypeDescriptor {
         } else {
             wdesc = (ValueDescriptor) repo.getDescriptor(oorig.getClass());
 
-            logger.finer("writeReplace -> " + _java_class.getName());
+            logger.finer("writeReplace -> " + type.getName());
         }
 
         return wdesc.copyObject2(oorig, state);
@@ -991,7 +988,7 @@ class ValueDescriptor extends TypeDescriptor {
             writeValue(writer, oorig);
             return writer;
         } catch (IOException ex) {
-            String msg = String.format("%s writing %s", ex, _java_class.getName());
+            String msg = String.format("%s writing %s", ex, type.getName());
             throw (MARSHAL) new MARSHAL(msg).initCause(ex);
         }
     }
@@ -1002,7 +999,7 @@ class ValueDescriptor extends TypeDescriptor {
             readValue(reader, copy);
             return readResolve(copy);
         } catch (IOException ex) {
-            String msg = String.format("%s reading instance of %s", ex, _java_class.getName());
+            String msg = String.format("%s reading instance of %s", ex, type.getName());
             throw (MARSHAL) new MARSHAL(msg).initCause(ex);
         }
     }
@@ -1021,7 +1018,7 @@ class ValueDescriptor extends TypeDescriptor {
 
         pw.print(paramName);
         pw.print(',');
-        MethodDescriptor.writeJavaType(pw, _java_class);
+        MethodDescriptor.writeJavaType(pw, type);
         pw.print(".class)");
     }
 
@@ -1030,12 +1027,13 @@ class ValueDescriptor extends TypeDescriptor {
         pw.print('.');
         pw.print("read_value");
         pw.print('(');
-        MethodDescriptor.writeJavaType(pw, _java_class);
+        MethodDescriptor.writeJavaType(pw, type);
         pw.print(".class)");
     }
 
+    @Override
     void addDependencies(Set<Class<?>> classes) {
-        Class c = _java_class;
+        Class c = type;
 
         if ((c == Object.class) || classes.contains(c))
             return;

http://git-wip-us.apache.org/repos/asf/geronimo-yoko/blob/431478f4/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueHandlerImpl.java
----------------------------------------------------------------------
diff --git a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueHandlerImpl.java b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueHandlerImpl.java
index 7004c25..6bfb65a 100755
--- a/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueHandlerImpl.java
+++ b/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueHandlerImpl.java
@@ -172,7 +172,7 @@ public class ValueHandlerImpl implements ValueHandler {
         if (val instanceof RMIStub) {
 
             RMIStub stub = (RMIStub) val;
-            Class type = stub._descriptor._java_class;
+            Class type = stub._descriptor.type;
 
             RMIState state = RMIState.current();
             Stub result = state.getStaticStub(stub._get_codebase(), type);


Mime
View raw message