geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1153312 - in /geronimo/yoko/trunk: yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ yoko-core/src/main/java/org/apache/yoko/orb/OB/ yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/
Date Wed, 03 Aug 2011 00:41:54 GMT
Author: djencks
Date: Wed Aug  3 00:41:53 2011
New Revision: 1153312

URL: http://svn.apache.org/viewvc?rev=1153312&view=rev
Log:
Revert "YOKO-434 nasty try-it-twice attempt to determine if the source class had a write object
method by seeing what deserializes correctly"

This reverts commit d83c1398aa91c0d8fba4d635adebff762f7647eb.

Modified:
    geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/InputStream.java
    geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java
    geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/CorbaObjectReader.java
    geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java

Modified: geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/InputStream.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/InputStream.java?rev=1153312&r1=1153311&r2=1153312&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/InputStream.java
(original)
+++ geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/InputStream.java
Wed Aug  3 00:41:53 2011
@@ -17,7 +17,6 @@
 
 package org.apache.yoko.orb.CORBA;
 
-import java.io.IOException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -64,9 +63,6 @@ final public class InputStream extends o
 
 	private String codebase_;
 
-    //mark support
-    private int mark_pos;
-
     // ------------------------------------------------------------------
     // Private and protected members
     // ------------------------------------------------------------------
@@ -2130,21 +2126,5 @@ final public class InputStream extends o
             valueReader_.checkChunk();
         }
     }
-
-    @Override
-    public void mark(int i) {
-        mark_pos = buf_.pos();
-    }
-
-    @Override
-    public boolean markSupported() {
-        return true;
-    }
-
-    @Override
-    public void reset() throws IOException {
-        buf_.pos(mark_pos);
-        mark_pos = 0;
-    }
 }
 

Modified: geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java?rev=1153312&r1=1153311&r2=1153312&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java (original)
+++ geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java Wed
Aug  3 00:41:53 2011
@@ -202,7 +202,7 @@ final public class ValueReader {
     //
     // Create a value using a factory
     //
-    static class FactoryCreationStrategy extends CreationStrategy {
+    private class FactoryCreationStrategy extends CreationStrategy {
         private String id_;
 
         private ORBInstance orbInstance_;
@@ -296,8 +296,8 @@ final public class ValueReader {
             Assert._OB_assert(h.tag >= 0x7fffff00 && h.tag != -1);
 
             if (h.isRMIValue ()) {
-                Serializable result = reader_.readRMIValue(h, null, h.ids[0]);
-                reader_.addInstance(h.headerPos, result);
+                Serializable result = readRMIValue (h, null, h.ids[0]);
+                addInstance (h.headerPos, result);
                 return result;
             }
             //

Modified: geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/CorbaObjectReader.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/CorbaObjectReader.java?rev=1153312&r1=1153311&r2=1153312&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/CorbaObjectReader.java
(original)
+++ geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/CorbaObjectReader.java
Wed Aug  3 00:41:53 2011
@@ -19,8 +19,6 @@
 package org.apache.yoko.rmi.impl;
 
 
-import java.io.IOException;
-
 public class CorbaObjectReader extends ObjectReader {
     final org.omg.CORBA_2_3.portable.InputStream in;
 
@@ -204,18 +202,4 @@ public class CorbaObjectReader extends O
         return in.available();
     }
 
-    @Override
-    public void mark(int i) {
-        in.mark(i);
-    }
-
-    @Override
-    public boolean markSupported() {
-        return in.markSupported();
-    }
-
-    @Override
-    public void reset() throws IOException {
-        in.reset();
-    }
 }

Modified: geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java?rev=1153312&r1=1153311&r2=1153312&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java
(original)
+++ geronimo/yoko/trunk/yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl/ValueDescriptor.java
Wed Aug  3 00:41:53 2011
@@ -818,49 +818,13 @@ public class ValueDescriptor extends Typ
 
         // System.out.println ("readValue "+getJavaClass());
 
-        //Determine if source object had a writeObject method.
-        //If the source object had a writeObject method, the next two bytes will be stream
format version and
-        //whether the write object method called defaultWriteObject.
-
-        //If the source object did not have a writeObject method, the next 4-byte-aligned
bit will be the start of a header
-        //for the first field.
-        //What if there are no fields?
-
-        //The only obvious way to do this is to, if the reader supports mark, try the way
suggested by the target class
-        // and if that doesn't work try the other possibility.
-
-        if (reader.markSupported()) {
-            reader.mark(7);
-        }
-        boolean hasWriteObjectMethod = _write_object_method != null;
-
-        try {
-            tryReadObject(reader, value, hasWriteObjectMethod);
-        } catch (org.omg.CORBA.MARSHAL e) {
-            if (reader.markSupported()) {
-                reader.reset();
-                tryReadObject(reader, value, !hasWriteObjectMethod);
-            } else {
-                throw e;
-            }
-        } catch (org.omg.CORBA.portable.UnknownException e) {
-            if (reader.markSupported()) {
-                reader.reset();
-                tryReadObject(reader, value, !hasWriteObjectMethod);
-            } else {
-                throw e;
-            }
-        }
-
-    }
-
-    private void tryReadObject(ObjectReader reader, Serializable value, boolean hasWriteObjectMethod)
throws IOException {
-        if (hasWriteObjectMethod) {
+        if (_write_object_method != null) {
 
             // read custom marshalling value header
             byte streamFormatVersion = reader.readByte();
             boolean writeDefaultStateCalled = reader.readBoolean();
         }
+
         if (_read_object_method != null) {
 
             // System.out.println ("readValue "+getJavaClass()+" calling
@@ -883,6 +847,7 @@ public class ValueDescriptor extends Typ
         } else {
             defaultReadValue(reader, value);
         }
+
     }
 
     protected long computeHashCode() {



Mime
View raw message