classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Initialising minor exception codes for CORBA MARSHAL e


From: Meskauskas Audrius
Subject: [cp-patches] FYI: Initialising minor exception codes for CORBA MARSHAL exception.
Date: Tue, 04 Oct 2005 19:52:10 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

To use the obtained VMCID, I documented 28 cases of throwing MARSHAL from our code. This may also happens under mistakes in the corresponding CORBA implementation that is talking with Classpath. The error code will be transferred back together with our signature.

2005-10-04  Audrius Meskauskas  <address@hidden>

* gnu/CORBA/Minor.java: New file.
* gnu/CORBA/CDR/IDLTypeHelper.java,
gnu/CORBA/CDR/UnknownExceptionCtxHandler.java,
gnu/CORBA/CDR/Vio.java,
gnu/CORBA/CDR/cdrInput.java,
gnu/CORBA/CDR/cdrOutput.java,
gnu/CORBA/CDR/gnuRuntime.java,
gnu/CORBA/CDR/noHeaderInput.java,
gnu/CORBA/DynAn/gnuDynValue.java,
gnu/CORBA/GIOP/CloseMessage.java,
gnu/CORBA/GIOP/ErrorMessage.java,
gnu/CORBA/GIOP/MessageHeader.java,
gnu/CORBA/GIOP/v1_2/RequestHeader.java,
gnu/CORBA/IOR.java,
gnu/CORBA/Poa/ForwardedServant.java,
gnu/CORBA/Version.java,
gnu/CORBA/cdrEncapsCodec.java,
gnu/CORBA/gnuAny.java,
gnu/CORBA/gnuRequest.java,
gnu/CORBA/streamReadyHolder.java,
gnu/CORBA/universalHolder.java,
gnu/javax/rmi/CORBA/UtilDelegateImpl.java,
gnu/javax/rmi/CORBA/corbaObjectOutput.java,
gnu/javax/rmi/CORBA/gnuRmiUtil.java,
org/omg/CORBA/MARSHAL.java,
org/omg/CORBA/StringValueHelper.java,
org/omg/CORBA/StructMemberHelper.java,
org/omg/CORBA/UnionMemberHelper.java,
org/omg/CORBA/ValueMemberHelper.java,
org/omg/CORBA/WStringValueHelper.java,
org/omg/CORBA/_IDLTypeStub.java,
org/omg/DynamicAny/DynAnyFactoryHelper.java,
org/omg/DynamicAny/_DynAnyFactoryStub.java,
org/omg/IOP/TaggedComponentHelper.java,
org/omg/IOP/TaggedProfileHelper.java,
org/omg/PortableInterceptor/CurrentHelper.java,
org/omg/PortableServer/POAHelper.java,
org/omg/PortableServer/ServantActivatorHelper.java,
org/omg/PortableServer/ServantLocatorHelper.java:
Initialising minor codes for MARSHAL.
* org/omg/CORBA/SystemException.java: Documentation update and
add minor code to the exception message.



? gnu/CORBA/Minor.java
Index: gnu/CORBA/IOR.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/IOR.java,v
retrieving revision 1.6
diff -u -r1.6 IOR.java
--- gnu/CORBA/IOR.java  28 Aug 2005 11:23:36 -0000      1.6
+++ gnu/CORBA/IOR.java  4 Oct 2005 15:29:28 -0000
@@ -310,6 +310,7 @@
       catch (Exception e)
         {
           MARSHAL m = new MARSHAL("Unable to write Internet profile.");
+          m.minor = Minor.IOR;
           m.initCause(e);
           throw m;
         }
Index: gnu/CORBA/Version.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Version.java,v
retrieving revision 1.4
diff -u -r1.4 Version.java
--- gnu/CORBA/Version.java      14 Sep 2005 21:12:21 -0000      1.4
+++ gnu/CORBA/Version.java      4 Oct 2005 15:32:06 -0000
@@ -123,7 +123,10 @@
       }
     catch (IOException ex)
       {
-        throw new MARSHAL("IOException while reading message header");
+        MARSHAL m = new MARSHAL("IOException while reading message header");
+        m.initCause(ex);
+        m.minor = Minor.Header;
+        throw m;
       }
   }
 
@@ -209,7 +212,10 @@
       }
     catch (IOException ex)
       {
-        throw new MARSHAL("IOException while writing message header");
+        MARSHAL m = new MARSHAL("IOException while writing message header");
+        m.minor = Minor.Header;
+        m.initCause(ex);
+        throw m;
       }
   }
  
Index: gnu/CORBA/cdrEncapsCodec.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/cdrEncapsCodec.java,v
retrieving revision 1.2
diff -u -r1.2 cdrEncapsCodec.java
--- gnu/CORBA/cdrEncapsCodec.java       2 Jul 2005 20:32:09 -0000       1.2
+++ gnu/CORBA/cdrEncapsCodec.java       4 Oct 2005 14:13:44 -0000
@@ -57,7 +57,7 @@
 /**
  * The local address@hidden Codec} implementation for ENCODING_CDR_ENCAPS
  * encoding. This is a local implementation; the remote side should
- * have its own Codec of this kind.
+ * have its own Codec of this kind. 
  *
  *
  * @author Audrius Meskauskas, Lithuania (address@hidden)
@@ -66,10 +66,10 @@
   extends LocalObject
   implements Codec
 {
-  /**
-   * The default version of encoding, used in parameterless constructor.
+  /** 
+   * Use serialVersionUID for interoperability. 
    */
-  private static final Version DEFAULT_VERSION = new Version(1, 2);
+  private static final long serialVersionUID = 1;
 
   /**
    * If set to true, no wide string or wide character is allowed (GIOP 1.0).
@@ -179,6 +179,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.Encapsulation;
         m.initCause(ex);
         throw m;
       }
@@ -248,6 +249,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.Encapsulation;
         m.initCause(ex);
         throw m;
       }
Index: gnu/CORBA/gnuAny.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/gnuAny.java,v
retrieving revision 1.8
diff -u -r1.8 gnuAny.java
--- gnu/CORBA/gnuAny.java       2 Oct 2005 19:58:00 -0000       1.8
+++ gnu/CORBA/gnuAny.java       4 Oct 2005 14:13:00 -0000
@@ -63,7 +63,6 @@
 import org.omg.CORBA.TypeCode;
 import org.omg.CORBA.TypeCodeHolder;
 import org.omg.CORBA.ValueBaseHolder;
-import org.omg.CORBA.portable.BoxedValueHelper;
 import org.omg.CORBA.portable.Streamable;
 
 import java.io.Serializable;
@@ -89,6 +88,11 @@
 public class gnuAny
   extends Any
 {
+  /** 
+   * Use serialVersionUID for interoperability. 
+   */
+  private static final long serialVersionUID = 1;
+  
   /**
    * The value, returned by address@hidden #type()} if the value has been
    * not intialized.
@@ -798,6 +802,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.Any;
         m.initCause(ex);
         throw m;
       }
Index: gnu/CORBA/gnuRequest.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/gnuRequest.java,v
retrieving revision 1.12
diff -u -r1.12 gnuRequest.java
--- gnu/CORBA/gnuRequest.java   2 Oct 2005 19:58:00 -0000       1.12
+++ gnu/CORBA/gnuRequest.java   4 Oct 2005 15:29:00 -0000
@@ -1101,7 +1101,9 @@
       }
     catch (IOException ex)
       {
-        throw new MARSHAL("Unable to write method arguments to CDR output.");
+        MARSHAL m = new MARSHAL("Unable to write method arguments to CDR 
output.");
+        m.minor = Minor.CDR;
+        throw m;
       }
   }
 
Index: gnu/CORBA/streamReadyHolder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/streamReadyHolder.java,v
retrieving revision 1.2
diff -u -r1.2 streamReadyHolder.java
--- gnu/CORBA/streamReadyHolder.java    2 Jul 2005 20:32:09 -0000       1.2
+++ gnu/CORBA/streamReadyHolder.java    4 Oct 2005 15:30:40 -0000
@@ -98,7 +98,10 @@
       }
     catch (IOException ex)
       {
-        throw new MARSHAL(ex + ":" + ex.getMessage());
+        MARSHAL m = new MARSHAL();
+        m.initCause(ex);
+        m.minor = Minor.CDR;
+        throw m;
       }
   }
 
Index: gnu/CORBA/universalHolder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/universalHolder.java,v
retrieving revision 1.4
diff -u -r1.4 universalHolder.java
--- gnu/CORBA/universalHolder.java      7 Aug 2005 17:17:43 -0000       1.4
+++ gnu/CORBA/universalHolder.java      4 Oct 2005 14:13:40 -0000
@@ -110,6 +110,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.Any;
         t.initCause(ex);
         throw t;
       }
@@ -142,6 +143,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.Any;
         t.initCause(ex);
         throw t;
       }
Index: gnu/CORBA/CDR/IDLTypeHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/CDR/IDLTypeHelper.java,v
retrieving revision 1.1
diff -u -r1.1 IDLTypeHelper.java
--- gnu/CORBA/CDR/IDLTypeHelper.java    2 Oct 2005 19:58:00 -0000       1.1
+++ gnu/CORBA/CDR/IDLTypeHelper.java    4 Oct 2005 14:59:04 -0000
@@ -38,6 +38,8 @@
 
 package gnu.CORBA.CDR;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.MARSHAL;
 import org.omg.CORBA.portable.BoxedValueHelper;
 import org.omg.CORBA.portable.InputStream;
@@ -97,6 +99,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL(msg() + " id()");
+        m.minor = Minor.Boxed;
         m.initCause(ex);
         throw m;
       }
@@ -115,6 +118,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL(msg() + " read(..)");
+        m.minor = Minor.Boxed;        
         m.initCause(ex);
         throw m;
       }
@@ -148,6 +152,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL(msg() + " write(..)");
+        m.minor = Minor.Boxed;        
         m.initCause(ex);
         throw m;
       }
Index: gnu/CORBA/CDR/UnknownExceptionCtxHandler.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/CORBA/CDR/UnknownExceptionCtxHandler.java,v
retrieving revision 1.1
diff -u -r1.1 UnknownExceptionCtxHandler.java
--- gnu/CORBA/CDR/UnknownExceptionCtxHandler.java       2 Oct 2005 19:58:00 
-0000       1.1
+++ gnu/CORBA/CDR/UnknownExceptionCtxHandler.java       4 Oct 2005 15:01:34 
-0000
@@ -38,6 +38,7 @@
 
 package gnu.CORBA.CDR;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.ObjectCreator;
 import gnu.CORBA.GIOP.ServiceContext;
 
@@ -274,11 +275,13 @@
           }
         catch (MARSHAL m)
           {
+            m.minor = Minor.Instantiation;
             throw m;
           }
         catch (Exception ex)
           {
             MARSHAL m = new MARSHAL("Unable to instantiate " + id);
+            m.minor = Minor.Instantiation;
             m.initCause(ex);
             throw m;
           }
Index: gnu/CORBA/CDR/Vio.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/CDR/Vio.java,v
retrieving revision 1.6
diff -u -r1.6 Vio.java
--- gnu/CORBA/CDR/Vio.java      2 Oct 2005 20:24:18 -0000       1.6
+++ gnu/CORBA/CDR/Vio.java      4 Oct 2005 15:22:20 -0000
@@ -38,6 +38,7 @@
 
 package gnu.CORBA.CDR;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.ObjectCreator;
 
 import org.omg.CORBA.CustomMarshal;
@@ -238,6 +239,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.Value;        
         m.initCause(ex);
         throw m;
       }
@@ -313,8 +315,12 @@
               {
                 if (value_class != null
                   && !value_class.isAssignableFrom(ox.getClass()))
-                  throw new MARSHAL(ox.getClass() + " is not a "
+                  {
+                    MARSHAL m = new MARSHAL(ox.getClass() + " is not a "
                     + value_class.getName());
+                    m.minor = Minor.ClassCast;
+                    throw m;
+                  }
               }
           }
         else
@@ -331,12 +337,12 @@
     catch (SystemException sysEx)
       {
         // OK.
-        sysEx.printStackTrace();
         throw sysEx;
       }
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL("Cant read " + value_class);
+        m.minor = Minor.Value;
         m.initCause(ex);
         throw m;
       }
@@ -414,6 +420,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.Value;
         m.initCause(ex);
         throw m;
       }
@@ -499,10 +506,10 @@
               }
           }
       }
-    catch (Throwable ex)
+    catch (IOException ex)
       {
-        ex.printStackTrace();
         MARSHAL m = new MARSHAL("Unable to read chunks");
+        m.minor = Minor.Value;
         m.initCause(ex);
         throw m;
       }
@@ -555,11 +562,23 @@
 
         // The nested value should be aways chunked.
         if ((value_tag & vf_CHUNKING) == 0)
-          throw new MARSHAL("readNestedValue: must be chunked");
+          {
+            MARSHAL m = new MARSHAL("readNestedValue: must be chunked");
+            m.minor = Minor.Chunks;
+            throw m;
+          }
         else if (value_tag == vt_NULL)
-          throw new MARSHAL("readNestedValue: null");
+          {
+            MARSHAL m = new MARSHAL("readNestedValue: nul");
+            m.minor = Minor.Chunks;
+            throw m;
+          }
         else if (value_tag == vt_INDIRECTION)
-          throw new MARSHAL("readNestedValue: indirection");
+          {
+            MARSHAL m = new MARSHAL("readNestedValue: indirection");
+            m.minor = Minor.Chunks;
+            throw m;
+          }
         else
           {
             // Read the value.
@@ -709,11 +728,19 @@
     if (!ok)
       {
         if (value != null)
-          throw new MARSHAL(value.getClass().getName()
+          {
+            MARSHAL m = new MARSHAL(value.getClass().getName()
             + " must be Streamable, CustomMarshal or Serializable");
+            m.minor = Minor.UnsupportedValue;
+            throw m;
+          }
         else
-          throw new MARSHAL("Unable to instantiate " + id + ":" + list(ids)
+          {
+            MARSHAL m = new MARSHAL("Unable to instantiate " + id + ":" + 
list(ids)
             + " helper " + helper);
+            m.minor = Minor.UnsupportedValue;
+            throw m;
+          }
       }
     else
       return (Serializable) value;
@@ -906,7 +933,7 @@
             else if (runtime.target == value)
               {
                 if (!writeSelf(output, value))
-                  throw new MARSHAL("Recursive helper call for "
+                  throw new InternalError("Recursive helper call for "
                     + value.getClass().getName());
                 return;
               }
@@ -1057,13 +1084,21 @@
 
     int offset = an_input.read_long();
     if (offset > -INT_SIZE)
-      throw new MARSHAL("Indirection tag refers to " + offset
+      {
+        MARSHAL m = new MARSHAL("Indirection tag refers to " + offset
         + " (must be less than -" + INT_SIZE + ")");
+        m.minor = Minor.Offset;
+        throw m;
+      }
 
     int stored_at = current_pos + offset;
 
     if (in.getRunTime() == null)
-      throw new MARSHAL(stored_at + " offset " + offset + ": not written");
+      {
+        MARSHAL m = new MARSHAL(stored_at + " offset " + offset + ": not 
written");
+        m.minor = Minor.Value;
+        throw m;
+      }
 
     return (Serializable) in.getRunTime().isObjectWrittenAt(stored_at, offset);
   }
@@ -1079,12 +1114,20 @@
   {
     if ((value_tag < 0x7fffff00 || value_tag > 0x7fffffff)
       && value_tag != vt_NULL && value_tag != vt_INDIRECTION)
-      throw new MARSHAL("Invalid value record, unsupported header tag: "
+      {
+        MARSHAL m = new MARSHAL("Invalid value record, unsupported header tag: 
"
         + value_tag + " (0x" + Integer.toHexString(value_tag) + ")");
+        m.minor = Minor.ValueHeaderTag;
+        throw m;
+      }
 
     if ((value_tag & vf_MULTIPLE_IDS) != 0 && (value_tag & vf_ID) == 0)
-      throw new MARSHAL("Invalid value record header flag combination (0x"
+      {
+        MARSHAL m = new MARSHAL("Invalid value record header flag combination 
(0x"
         + Integer.toHexString(value_tag) + ")");
+        m.minor = Minor.ValueHeaderFlags;
+        throw m;
+      }
   }
 
   /**
@@ -1096,6 +1139,7 @@
     MARSHAL m = new MARSHAL(msg + ":'" + id1 + "' versus '" + id2 + "'");
     if (e != null)
       m.initCause(e);
+    m.minor = Minor.Value;
     throw m;
   }
 
@@ -1177,6 +1221,7 @@
         catch (Exception ex)
           {
             MARSHAL m = new MARSHAL("Unable to instantiate " + id);
+            m.minor = Minor.Instantiation;
             m.initCause(ex);
             throw m;
           }
Index: gnu/CORBA/CDR/cdrInput.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/CDR/cdrInput.java,v
retrieving revision 1.10
diff -u -r1.10 cdrInput.java
--- gnu/CORBA/CDR/cdrInput.java 2 Oct 2005 19:58:00 -0000       1.10
+++ gnu/CORBA/CDR/cdrInput.java 4 Oct 2005 14:51:20 -0000
@@ -44,6 +44,7 @@
 import gnu.CORBA.GIOP.cxCodeSet;
 import gnu.CORBA.IOR;
 import gnu.CORBA.IOR_Delegate;
+import gnu.CORBA.Minor;
 import gnu.CORBA.TypeCodeHelper;
 import gnu.CORBA.Unexpected;
 import gnu.CORBA.Version;
@@ -81,18 +82,17 @@
 import java.math.BigDecimal;
 
 /**
- * A simple CORBA CDR (common data representation)
- * input stream, reading data from the
- * given address@hidden java.io.InputStream}. The primitive types
- * are aligned on they natural boundaries by implementing the
- * abstract method address@hidden #align(int boundary)}.
- *
- * The same class also implements address@hidden 
org.omg.CORBA.DataInputStream} to
- * read the object content in a user defined way.
+ * A simple CORBA CDR (common data representation) input stream, reading data
+ * from the given address@hidden java.io.InputStream}. The primitive types are 
aligned
+ * on they natural boundaries by implementing the abstract method
+ * address@hidden #align(int boundary)}.
+ * 
+ * The same class also implements address@hidden 
org.omg.CORBA.DataInputStream} to read
+ * the object content in a user defined way.
+ * 
+ * TODO This class uses 16 bits per Unicode character only, as it was until jdk
+ * 1.4 inclusive.
  * 
- * TODO This class uses 16 bits per Unicode character only, as it was until
- * jdk 1.4 inclusive.
- *
  * @author Audrius Meskauskas (address@hidden)
  */
 public abstract class cdrInput
@@ -100,28 +100,26 @@
   implements org.omg.CORBA.DataInputStream
 {
   /**
-   * The runtime, associated with this stream. This field is only used when 
+   * The runtime, associated with this stream. This field is only used when
    * reading and writing value types and filled-in in gnu.CORBA.CDR.Vio.
    */
-  public transient gnuRuntime runtime;  
-  
+  public transient gnuRuntime runtime;
+
   /**
-   * The message, explaining that the exception has been thrown due
-   * unexpected end of the input stream. This usually happens the
-   * server and client disagree on communication or data representation
-   * rules.
+   * The message, explaining that the exception has been thrown due unexpected
+   * end of the input stream. This usually happens the server and client
+   * disagree on communication or data representation rules.
    */
   protected static final String UNEXP_EOF = "Unexpected end of stream";
 
   /**
-   * This instance is used to convert primitive data types into the
-   * byte sequences.
+   * This instance is used to convert primitive data types into the byte
+   * sequences.
    */
   protected abstractDataInputStream b;
 
   /**
-   * The input stream, from where the data are actually
-   * being read.
+   * The input stream, from where the data are actually being read.
    */
   protected java.io.InputStream actual_stream;
 
@@ -141,43 +139,41 @@
   protected cxCodeSet codeset = cxCodeSet.STANDARD;
 
   /**
-   * The name of the currently used narrow charset, null if
-   * the native narrow charset is used.
+   * The name of the currently used narrow charset, null if the native narrow
+   * charset is used.
    */
   private String narrow_charset = null;
 
   /**
-   * The name of the currently used wide charset, null if
-   * the native wide charset is used.
+   * The name of the currently used wide charset, null if the native wide
+   * charset is used.
    */
   private String wide_charset = null;
 
   /**
-   * True if the native code set is used for narrow characters.
-   * If the set is native, no the intermediate Reader object
-   * is instantiated when writing characters.
+   * True if the native code set is used for narrow characters. If the set is
+   * native, no the intermediate Reader object is instantiated when writing
+   * characters.
    */
   private boolean narrow_native;
 
   /**
-   * True if the native code set is used for wide characters.
-   * If the set is native, no the intermediate Reader object
-   * is instantiated when writing characters.
+   * True if the native code set is used for wide characters. If the set is
+   * native, no the intermediate Reader object is instantiated when writing
+   * characters.
    */
   private boolean wide_native;
 
   /**
-   * If true, the stream expect
-   * the multi-byte data in the form "less significant byte
-   * first" (Little Endian). This is the opposite to the
-   * java standard (Big Endian).
+   * If true, the stream expect the multi-byte data in the form "less
+   * significant byte first" (Little Endian). This is the opposite to the java
+   * standard (Big Endian).
    */
   private boolean little_endian;
 
   /**
-   * Creates the stream. The stream reads Big Endian by
-   * default.
-   *
+   * Creates the stream. The stream reads Big Endian by default.
+   * 
    * @param readFrom a stream to read CORBA input from.
    */
   public cdrInput(java.io.InputStream readFrom)
@@ -187,8 +183,8 @@
   }
 
   /**
-   * Creates the stream, requiring the subsequent call
-   * of address@hidden #setInputStream(java.io.InputStream)}.
+   * Creates the stream, requiring the subsequent call of
+   * address@hidden #setInputStream(java.io.InputStream)}.
    */
   public cdrInput()
   {
@@ -196,13 +192,12 @@
   }
 
   /**
-   * Set the Big Endian or Little Endian encoding.
-   * The stream reads Big Endian by default.
-   *
-   * @param use_little_endian if true, the stream expect
-   * the multi-byte data in the form "less significant byte
-   * first" (Little Endian). This is the opposite to the
-   * java standard (Big Endian).
+   * Set the Big Endian or Little Endian encoding. The stream reads Big Endian
+   * by default.
+   * 
+   * @param use_little_endian if true, the stream expect the multi-byte data in
+   * the form "less significant byte first" (Little Endian). This is the
+   * opposite to the java standard (Big Endian).
    */
   public void setBigEndian(boolean use_big_endian)
   {
@@ -212,14 +207,14 @@
 
   /**
    * Get the used encoding.
-   *
+   * 
    * @param true for Big Endian, false for Little Endian.
    */
   public boolean isBigEndian()
   {
     return !little_endian;
   }
-  
+
   /**
    * Clone all important settings to another stream.
    */
@@ -233,7 +228,7 @@
 
   /**
    * Set the input stream that receives the CORBA input.
-   *
+   * 
    * @param readFrom the stream.
    */
   public void setInputStream(java.io.InputStream readFrom)
@@ -247,13 +242,14 @@
   }
 
   /**
-   * Set the alignment offset, if the index of the first byte in the
-   * stream is different from 0.
+   * Set the alignment offset, if the index of the first byte in the stream is
+   * different from 0.
    */
   public abstract void setOffset(int offset);
 
   /**
    * Set the orb, associated with this stream.
+   * 
    * @param an_orb
    */
   public void setOrb(ORB an_orb)
@@ -262,8 +258,8 @@
   }
 
   /**
-   * Set the GIOP version. Some data types are written differently
-   * for the different versions. The default version is 1.0 .
+   * Set the GIOP version. Some data types are written differently for the
+   * different versions. The default version is 1.0 .
    */
   public void setVersion(Version giop_version)
   {
@@ -276,8 +272,8 @@
   public abstract void align(int boundary);
 
   /**
-   * Reads the CORBA unsigned long (java int), returning the
-   * value in the sufficiently large java long.
+   * Reads the CORBA unsigned long (java int), returning the value in the
+   * sufficiently large java long.
    */
   public long gnu_read_ulong()
   {
@@ -290,6 +286,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -300,8 +297,8 @@
   }
 
   /**
-   * Read the unsigned short integer value and return it as java
-   * int, sufficiently large to hold all values.
+   * Read the unsigned short integer value and return it as java int,
+   * sufficiently large to hold all values.
    */
   public int gnu_read_ushort()
   {
@@ -313,6 +310,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -325,6 +323,7 @@
 
   /**
    * Return the associated address@hidden ORB}.
+   * 
    * @return the associated address@hidden ORB} or null is no such is set.
    */
   public ORB orb()
@@ -336,7 +335,7 @@
    * Read a single byte directly from the buffer.
    */
   public int read()
-           throws java.io.IOException
+    throws java.io.IOException
   {
     try
       {
@@ -345,6 +344,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -354,7 +354,7 @@
    * Read bytes directly from the buffer.
    */
   public int read(byte[] x, int ofs, int len)
-           throws java.io.IOException
+    throws java.io.IOException
   {
     try
       {
@@ -363,6 +363,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -372,7 +373,7 @@
    * Read bytes directly from the buffer.
    */
   public int read(byte[] x)
-           throws java.io.IOException
+    throws java.io.IOException
   {
     try
       {
@@ -381,24 +382,25 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
   }
 
   /**
-   * Read the CORBA object. The object to read is represented in the
-   * form of the plain (not a string-encoded) IOR profile without the
-   * heading endian indicator. The responsible method for reading such
-   * data is address@hidden IOR.read_no_endian}.
-   *
-   * The returned object is usually casted into the given type using
-   * the .narrow method of its helper, despite in some cases the direct
-   * cast would also work.
-   *
-   * The null objects are recognised from the empty profile set.
-   * For such objects, null is returned.
-   *
+   * Read the CORBA object. The object to read is represented in the form of 
the
+   * plain (not a string-encoded) IOR profile without the heading endian
+   * indicator. The responsible method for reading such data is
+   * address@hidden IOR.read_no_endian}.
+   * 
+   * The returned object is usually casted into the given type using the 
.narrow
+   * method of its helper, despite in some cases the direct cast would also
+   * work.
+   * 
+   * The null objects are recognised from the empty profile set. For such
+   * objects, null is returned.
+   * 
    * @return the loaded and constructed object.
    */
   public org.omg.CORBA.Object read_Object()
@@ -447,8 +449,8 @@
   }
 
   /**
-   * Read the type code. The type code format is defined in the
-   * CORBA documenation.
+   * Read the type code. The type code format is defined in the CORBA
+   * documenation.
    */
   public TypeCode read_TypeCode()
   {
@@ -468,9 +470,8 @@
   }
 
   /**
-   * Read the CORBA address@hidden Any}. This method first reads the
-   * type code, then delegates the functionality
-   * to address@hidden Any#read_value}.
+   * Read the CORBA address@hidden Any}. This method first reads the type 
code, then
+   * delegates the functionality to address@hidden Any#read_value}.
    */
   public Any read_any()
   {
@@ -481,8 +482,7 @@
   }
 
   /**
-   * Read the boolean, treating any non zero byte as true,
-   * zero byte as false.
+   * Read the boolean, treating any non zero byte as true, zero byte as false.
    */
   public boolean read_boolean()
   {
@@ -493,6 +493,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -511,12 +512,13 @@
       {
         for (int i = offs; i < offs + len; i++)
           {
-            x [ i ] = b.read() == 0 ? false : true;
+            x[i] = b.read() == 0 ? false : true;
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -528,8 +530,8 @@
   }
 
   /**
-   * Read a character using narrow charset encoding. Depending form
-   * which encoding is set, this still can be Unicode or ever wider.
+   * Read a character using narrow charset encoding. Depending form which
+   * encoding is set, this still can be Unicode or ever wider.
    */
   public char read_char()
   {
@@ -543,6 +545,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -563,18 +566,19 @@
         if (narrow_native)
           {
             for (int i = offset; i < offset + length; i++)
-              x [ i ] = (char) b.read();
+              x[i] = (char) b.read();
           }
         else
           {
-            InputStreamReader reader =
-              new InputStreamReader((InputStream) b, narrow_charset);
+            InputStreamReader reader = new InputStreamReader((InputStream) b,
+              narrow_charset);
             reader.read(x, offset, length);
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -598,6 +602,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -618,12 +623,13 @@
         align(8);
         for (int i = offs; i < offs + len; i++)
           {
-            x [ i ] = b.readDouble();
+            x[i] = b.readDouble();
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -635,10 +641,9 @@
   }
 
   /**
-   * Read the encapsulated stream.
-   * If the encapsulated sequence appears to be in the
-   * Little endian format, the flag of the returned stream
-   * is set to read Little endian.
+   * Read the encapsulated stream. If the encapsulated sequence appears to be 
in
+   * the Little endian format, the flag of the returned stream is set to read
+   * Little endian.
    */
   public cdrBufInput read_encapsulation()
   {
@@ -646,10 +651,9 @@
       {
         int l = read_long();
 
-        byte[] r = new byte[ l ];
+        byte[] r = new byte[l];
         int n = 0;
-        reading:
-        while (n < r.length)
+        reading: while (n < r.length)
           {
             n += read(r, n, r.length - n);
           }
@@ -669,6 +673,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -680,9 +685,8 @@
   }
 
   /**
-   * Read the CORBA fixed (the end of the <code>fixed</code>
-   * can be determined by its last byte). The scale is always
-   * assumed to be zero.
+   * Read the CORBA fixed (the end of the <code>fixed</code> can be determined
+   * by its last byte). The scale is always assumed to be zero.
    */
   public BigDecimal read_fixed()
   {
@@ -693,6 +697,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -716,6 +721,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -736,12 +742,13 @@
         align(4);
         for (int i = offs; i < offs + len; i++)
           {
-            x [ i ] = b.readFloat();
+            x[i] = b.readFloat();
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -765,6 +772,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -785,12 +793,13 @@
         align(4);
         for (int i = offs; i < offs + len; i++)
           {
-            x [ i ] = b.readInt();
+            x[i] = b.readInt();
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -813,7 +822,9 @@
       }
     catch (EOFException ex)
       {
-        throw new MARSHAL(UNEXP_EOF);
+        MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
+        throw t;
       }
 
     catch (IOException ex)
@@ -832,12 +843,13 @@
         align(8);
         for (int i = offs; i < offs + len; i++)
           {
-            x [ i ] = b.readLong();
+            x[i] = b.readLong();
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -860,6 +872,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -882,6 +895,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -893,15 +907,14 @@
   }
 
   /**
-   * Read the length of the byte array as CORBA long and then
-   * the array itseld.
+   * Read the length of the byte array as CORBA long and then the array itseld.
    */
   public byte[] read_sequence()
   {
     try
       {
         int l = read_long();
-        byte[] buf = new byte[ l ];
+        byte[] buf = new byte[l];
         if (l > 0)
           {
             b.readFully(buf);
@@ -911,6 +924,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -934,6 +948,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -954,12 +969,13 @@
         align(2);
         for (int i = offs; i < offs + len; i++)
           {
-            x [ i ] = b.readShort();
+            x[i] = b.readShort();
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -997,6 +1013,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -1006,14 +1023,16 @@
       }
     catch (NegativeArraySizeException nex)
       {
-        throw new MARSHAL("Input stream broken, got " + n + "(0x"
+        MARSHAL m = new MARSHAL("Input stream broken, got " + n + "(0x"
           + Integer.toHexString(n) + ") as a string size");
+        m.minor = Minor.Negative;
+        throw m;
       }
   }
 
   /**
-   * Reads the CORBA unsigned long (java int), delegating
-   * functionality to address@hidden #read_long}.
+   * Reads the CORBA unsigned long (java int), delegating functionality to
+   * address@hidden #read_long}.
    */
   public int read_ulong()
   {
@@ -1021,9 +1040,8 @@
   }
 
   /**
-   * Reads the array of CORBA unsigned long (java integer) values,
-   * delegating functionality to
-   * address@hidden #real_long_array}.
+   * Reads the array of CORBA unsigned long (java integer) values, delegating
+   * functionality to address@hidden #real_long_array}.
    */
   public void read_ulong_array(int[] x, int offs, int len)
   {
@@ -1031,11 +1049,9 @@
   }
 
   /**
-   * Read the CORBA unsigned long long value,
-   * delegating functionality to address@hidden #read_longlong}.
-   * There is no way to return values over the limit of
-   * the java signed long in other way than returning
-   * the negative value.
+   * Read the CORBA unsigned long long value, delegating functionality to
+   * address@hidden #read_longlong}. There is no way to return values over the 
limit of
+   * the java signed long in other way than returning the negative value.
    */
   public long read_ulonglong()
   {
@@ -1043,9 +1059,8 @@
   }
 
   /**
-   * Reads the array of CORBA long long (java long) values,
-   * delegating functionality to
-   * address@hidden #real_longlong_array}.
+   * Reads the array of CORBA long long (java long) values, delegating
+   * functionality to address@hidden #real_longlong_array}.
    */
   public void read_ulonglong_array(long[] x, int offs, int len)
   {
@@ -1053,10 +1068,9 @@
   }
 
   /**
-   * Read the unsigned short integer value. Due strange specification,
-   * the returned value must be the short type as well, so the
-   * the best solution seems just to delegete functionality to
-   * read_short.
+   * Read the unsigned short integer value. Due strange specification, the
+   * returned value must be the short type as well, so the the best solution
+   * seems just to delegete functionality to read_short.
    */
   public short read_ushort()
   {
@@ -1064,8 +1078,8 @@
   }
 
   /**
-   * Read an array of unsigned short values, delegating the
-   * functionality to address@hidden read_short_array}.
+   * Read an array of unsigned short values, delegating the functionality to
+   * address@hidden read_short_array}.
    */
   public void read_ushort_array(short[] x, int offs, int len)
   {
@@ -1094,7 +1108,11 @@
             if (l == 2 && wide_native)
               return b.readChar();
             else if (l <= 0)
-              throw new MARSHAL("wchar size " + l);
+              {
+                 MARSHAL m = new MARSHAL("wchar size " + l);
+                 m.minor = Minor.Negative;
+                 throw m;
+              }
             else
               {
                 byte[] bytes = new byte[l];
@@ -1119,8 +1137,6 @@
                 else
                   cs = new String(bytes, wide_charset);
 
-                if (cs.length() != 1)
-                  throw new MARSHAL("Wide char decoded as '" + cs + "'");
                 return cs.charAt(0);
               }
           }
@@ -1128,6 +1144,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -1151,18 +1168,19 @@
         if (wide_native)
           {
             for (int i = offset; i < offset + length; i++)
-              x [ i ] = (char) b.readShort();
+              x[i] = (char) b.readShort();
           }
         else
           {
-            InputStreamReader reader =
-              new InputStreamReader((InputStream) b, wide_charset);
+            InputStreamReader reader = new InputStreamReader((InputStream) b,
+              wide_charset);
             reader.read(x, offset, length);
           }
       }
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -1174,13 +1192,11 @@
   }
 
   /**
-   * Reads the string in wide character format
-   * (ussually UTF-16, Unicode). Takes the currently set charset
-   * into consideration.
-   *
-   * If the native (UTF-16) encoding is used
-   * of the GIOP protocol is before 1.2, delegates functionality
-   * to "plain" address@hidden #read_wstring_UTF_16}.
+   * Reads the string in wide character format (ussually UTF-16, Unicode). 
Takes
+   * the currently set charset into consideration.
+   * 
+   * If the native (UTF-16) encoding is used of the GIOP protocol is before 
1.2,
+   * delegates functionality to "plain" address@hidden #read_wstring_UTF_16}.
    */
   public String read_wstring()
   {
@@ -1192,7 +1208,7 @@
         align(4);
 
         int n = b.readInt();
-        byte[] s = new byte[ n ];
+        byte[] s = new byte[n];
         b.read(s);
 
         return new String(s, 0, n, wide_charset);
@@ -1200,6 +1216,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -1211,9 +1228,9 @@
   }
 
   /**
-   * Reads first length of the string and the all characters as an
-   * Unicode (UTF-16) characters. Mind that GIOP 1.1 has the extra
-   * null character at the end that must be discarded.
+   * Reads first length of the string and the all characters as an Unicode
+   * (UTF-16) characters. Mind that GIOP 1.1 has the extra null character at 
the
+   * end that must be discarded.
    */
   public String read_wstring_UTF_16()
   {
@@ -1221,6 +1238,13 @@
       {
         int p = 0;
         int n = read_long();
+        
+        if (n<0)
+          {
+            MARSHAL m = new MARSHAL("Negative string size");
+            m.minor = Minor.Negative;
+            throw m;
+          }
 
         // The null terminator that is no longer present since 1.2 .
         int nt = giop.since_inclusive(1, 2) ? 0 : 1;
@@ -1229,28 +1253,29 @@
         n = n / 2;
 
         // Empty string.
-        if (n==0) return "";
-        
-        char[] s = new char[ n ];
+        if (n == 0)
+          return "";
+
+        char[] s = new char[n];
 
         for (int i = 0; i < s.length; i++)
-          s [ i ] = (char) b.readShort();
+          s[i] = (char) b.readShort();
 
         // Check for the byte order marker here.
-        if (s [ 0 ] == 0xFEFF)
+        if (s[0] == 0xFEFF)
           {
             // Big endian encoding - do nothing, but move the pointer
             // one position forward.
             p = 1;
           }
-        else if (s [ 0 ] == 0xFFFE)
+        else if (s[0] == 0xFFFE)
           {
             // Little endian encoding, swap the bytes and move one
             // position forward.
             p = 1;
 
             for (int i = p; i < s.length; i++)
-              s [ i ] = swap(s [ i ]);
+              s[i] = swap(s[i]);
           }
 
         // Discard the null terminator and, if needed, the endian marker.
@@ -1260,6 +1285,7 @@
     catch (EOFException ex)
       {
         MARSHAL t = new MARSHAL(UNEXP_EOF);
+        t.minor = Minor.EOF;
         t.initCause(ex);
         throw t;
       }
@@ -1309,9 +1335,9 @@
    * Read the object that is an instance of the given class. The current
    * implementation delegates functionality to the parameterless
    * address@hidden readObject()}.
-   *
+   * 
    * @param klass a class of that this object the instance is.
-   *
+   * 
    * @return the returned object.
    */
   public org.omg.CORBA.Object read_Object(Class klass)
@@ -1321,11 +1347,11 @@
 
   /**
    * Read a value type structure from the stream.
-   *
-   * OMG specification states the writing format is outside the scope
-   * of GIOP definition. This implementation uses java serialization
-   * mechanism, calling address@hidden ObjectInputStream#readObject}
-   *
+   * 
+   * OMG specification states the writing format is outside the scope of GIOP
+   * definition. This implementation uses java serialization mechanism, calling
+   * address@hidden ObjectInputStream#readObject}
+   * 
    * @return an value type structure, unmarshaled from the stream
    */
   public Serializable read_Value()
@@ -1334,14 +1360,13 @@
   }
 
   /**
-   * Read the abstract interface. An abstract interface can be either
-   * CORBA value type or CORBA object and is returned as an abstract
-   * java.lang.Object.
-   *
-   * As specified in OMG specification, this reads a single
-   * boolean and then delegates either to address@hidden #read_Object()} (for 
false)
-   * or to address@hidden #read_Value()} (for true).
-   *
+   * Read the abstract interface. An abstract interface can be either CORBA
+   * value type or CORBA object and is returned as an abstract 
java.lang.Object.
+   * 
+   * As specified in OMG specification, this reads a single boolean and then
+   * delegates either to address@hidden #read_Object()} (for false) or to
+   * address@hidden #read_Value()} (for true).
+   * 
    * @return an abstract interface, unmarshaled from the stream
    */
   public java.lang.Object read_Abstract()
@@ -1350,10 +1375,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_char_array(CharSeqHolder holder, int offset, int length)
   {
@@ -1362,10 +1387,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_wchar_array(WCharSeqHolder holder, int offset, int length)
   {
@@ -1374,23 +1399,23 @@
   }
 
   /**
-   * If required, allocate or resize the char array to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the char array to fit the newly read
+   * values.
+   * 
    * @param holder_value the existing char array, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private char[] ensureArray(char[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new char[ offset + length ];
+      return new char[offset + length];
     else if (holder_value.length < offset + length)
       {
-        char[] value = new char[ offset + length ];
+        char[] value = new char[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1399,10 +1424,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_ulong_array(ULongSeqHolder holder, int offset, int length)
   {
@@ -1411,10 +1436,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_long_array(LongSeqHolder holder, int offset, int length)
   {
@@ -1423,23 +1448,22 @@
   }
 
   /**
-   * If required, allocate or resize the int array to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the int array to fit the newly read 
values.
+   * 
    * @param holder_value the existing int array, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private int[] ensureArray(int[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new int[ offset + length ];
+      return new int[offset + length];
     else if (holder_value.length < offset + length)
       {
-        int[] value = new int[ offset + length ];
+        int[] value = new int[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1448,10 +1472,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_float_array(FloatSeqHolder holder, int offset, int length)
   {
@@ -1460,23 +1484,23 @@
   }
 
   /**
-   * If required, allocate or resize the float array to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the float array to fit the newly read
+   * values.
+   * 
    * @param holder_value the existing float array, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private float[] ensureArray(float[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new float[ offset + length ];
+      return new float[offset + length];
     else if (holder_value.length < offset + length)
       {
-        float[] value = new float[ offset + length ];
+        float[] value = new float[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1485,10 +1509,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_double_array(DoubleSeqHolder holder, int offset, int length)
   {
@@ -1497,23 +1521,23 @@
   }
 
   /**
-   * If required, allocate or resize the double array to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the double array to fit the newly read
+   * values.
+   * 
    * @param holder_value the existing double array, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private double[] ensureArray(double[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new double[ offset + length ];
+      return new double[offset + length];
     else if (holder_value.length < offset + length)
       {
-        double[] value = new double[ offset + length ];
+        double[] value = new double[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1522,10 +1546,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_short_array(ShortSeqHolder holder, int offset, int length)
   {
@@ -1541,23 +1565,23 @@
   }
 
   /**
-   * If required, allocate or resize the short array to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the short array to fit the newly read
+   * values.
+   * 
    * @param holder_value the existing short array, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private short[] ensureArray(short[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new short[ offset + length ];
+      return new short[offset + length];
     else if (holder_value.length < offset + length)
       {
-        short[] value = new short[ offset + length ];
+        short[] value = new short[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1566,10 +1590,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_octet_array(OctetSeqHolder holder, int offset, int length)
   {
@@ -1578,23 +1602,23 @@
   }
 
   /**
-   * If required, allocate or resize the byte array to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the byte array to fit the newly read
+   * values.
+   * 
    * @param holder_value the existing byte array, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private byte[] ensureArray(byte[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new byte[ offset + length ];
+      return new byte[offset + length];
     else if (holder_value.length < offset + length)
       {
-        byte[] value = new byte[ offset + length ];
+        byte[] value = new byte[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1603,51 +1627,49 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_longlong_array(LongLongSeqHolder holder, int offset,
-                                  int length
-                                 )
+    int length)
   {
     holder.value = ensureArray(holder.value, offset, length);
     read_longlong_array(holder.value, offset, length);
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_ulonglong_array(ULongLongSeqHolder holder, int offset,
-                                   int length
-                                  )
+    int length)
   {
     holder.value = ensureArray(holder.value, offset, length);
     read_ulonglong_array(holder.value, offset, length);
   }
 
   /**
-   * If required, allocate or resize the array of longs to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the array of longs to fit the newly read
+   * values.
+   * 
    * @param holder_value the existing array, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private long[] ensureArray(long[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new long[ offset + length ];
+      return new long[offset + length];
     else if (holder_value.length < offset + length)
       {
-        long[] value = new long[ offset + length ];
+        long[] value = new long[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1656,10 +1678,10 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_boolean_array(BooleanSeqHolder holder, int offset, int 
length)
   {
@@ -1668,23 +1690,23 @@
   }
 
   /**
-   * If required, allocate or resize the array of booleans to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the array of booleans to fit the newly 
read
+   * values.
+   * 
    * @param holder_value the existing array of booleans, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private boolean[] ensureArray(boolean[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new boolean[ offset + length ];
+      return new boolean[offset + length];
     else if (holder_value.length < offset + length)
       {
-        boolean[] value = new boolean[ offset + length ];
+        boolean[] value = new boolean[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1693,38 +1715,38 @@
   }
 
   /**
-   * Read an array. In OMG specification is written that if the data does
-   * not fit into the holder value field, that array must be resized.
-   * The implementation follows this rule. If the holder value field
-   * contains null, it is newly instantiated.
+   * Read an array. In OMG specification is written that if the data does not
+   * fit into the holder value field, that array must be resized. The
+   * implementation follows this rule. If the holder value field contains null,
+   * it is newly instantiated.
    */
   public void read_any_array(AnySeqHolder holder, int offset, int length)
   {
     holder.value = ensureArray(holder.value, offset, length);
     for (int i = offset; i < offset + length; i++)
       {
-        holder.value [ i ] = read_any();
+        holder.value[i] = read_any();
       }
   }
 
   /**
-   * If required, allocate or resize the array of Anys to fit the newly
-   * read values.
-   *
+   * If required, allocate or resize the array of Anys to fit the newly read
+   * values.
+   * 
    * @param holder_value the existing array of Anys, may be null.
    * @param offset the required offset to read.
    * @param length the length of the new sequence.
-   *
+   * 
    * @return the allocated or resized array, same array if no such operations
    * are required.
    */
   private Any[] ensureArray(Any[] holder_value, int offset, int length)
   {
     if (holder_value == null)
-      return new Any[ offset + length ];
+      return new Any[offset + length];
     else if (holder_value.length < offset + length)
       {
-        Any[] value = new Any[ offset + length ];
+        Any[] value = new Any[offset + length];
         System.arraycopy(holder_value, 0, value, 0, holder_value.length);
         return value;
       }
@@ -1733,11 +1755,10 @@
   }
 
   /**
-   * This method is required to represent the DataInputStream as a value
-   * type object.
-   *
-   * @return a single entity "IDL:omg.org/CORBA/DataInputStream:1.0",
-   * always.
+   * This method is required to represent the DataInputStream as a value type
+   * object.
+   * 
+   * @return a single entity "IDL:omg.org/CORBA/DataInputStream:1.0", always.
    */
   public String[] _truncatable_ids()
   {
Index: gnu/CORBA/CDR/cdrOutput.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/CDR/cdrOutput.java,v
retrieving revision 1.10
diff -u -r1.10 cdrOutput.java
--- gnu/CORBA/CDR/cdrOutput.java        2 Oct 2005 19:58:00 -0000       1.10
+++ gnu/CORBA/CDR/cdrOutput.java        4 Oct 2005 14:05:44 -0000
@@ -41,6 +41,7 @@
 import gnu.CORBA.BigDecimalHelper;
 import gnu.CORBA.IOR;
 import gnu.CORBA.IorProvider;
+import gnu.CORBA.Minor;
 import gnu.CORBA.TypeCodeHelper;
 import gnu.CORBA.Unexpected;
 import gnu.CORBA.Version;
@@ -748,6 +749,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.CDR;
         t.initCause(ex);
         throw t;
       }
@@ -769,6 +771,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.CDR;
         t.initCause(ex);
         throw t;
       }
Index: gnu/CORBA/CDR/gnuRuntime.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/CDR/gnuRuntime.java,v
retrieving revision 1.2
diff -u -r1.2 gnuRuntime.java
--- gnu/CORBA/CDR/gnuRuntime.java       2 Oct 2005 20:24:18 -0000       1.2
+++ gnu/CORBA/CDR/gnuRuntime.java       4 Oct 2005 14:56:54 -0000
@@ -38,7 +38,8 @@
 
 package gnu.CORBA.CDR;
 
-import org.omg.CORBA.CompletionStatus;
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.LocalObject;
 import org.omg.CORBA.MARSHAL;
 
@@ -234,8 +235,12 @@
     else if (e != null)
       return e.object;
     else
-      throw new MARSHAL("No object was written at " + x + " (offset " + offset
-        + ") r " + this + dump());
+      {
+        MARSHAL m = new MARSHAL("No object was written at " + x + 
+          " (offset " + offset + ") r " + this + dump());
+        m.minor = Minor.Graph;
+        throw m;
+      }
   }
 
   /**
@@ -244,7 +249,8 @@
   public void singleIdWritten(String id, int at)
   {
     if (sh_ids.containsKey(id))
-      throw new Error("Repetetive writing of the same string " + id + dump());
+      throw new InternalError("Repetetive writing of the same string " +
+        id + dump());
 
     Entry e = new Entry();
     e.at = at;
@@ -260,7 +266,8 @@
   public void multipleIdsWritten(String[] ids, int at)
   {
     if (sh_ids.containsKey(ids))
-      throw new Error("Repetetive writing of the same string " + ids + dump());
+      throw new InternalError("Repetetive writing of the same string " + 
+        ids + dump());
 
     Entry e = new Entry();
     e.at = at;
Index: gnu/CORBA/CDR/noHeaderInput.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/CDR/noHeaderInput.java,v
retrieving revision 1.2
diff -u -r1.2 noHeaderInput.java
--- gnu/CORBA/CDR/noHeaderInput.java    2 Oct 2005 19:58:00 -0000       1.2
+++ gnu/CORBA/CDR/noHeaderInput.java    4 Oct 2005 14:59:36 -0000
@@ -38,6 +38,8 @@
 
 package gnu.CORBA.CDR;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.Any;
 import org.omg.CORBA.AnySeqHolder;
 import org.omg.CORBA.BooleanSeqHolder;
@@ -192,6 +194,7 @@
           {
             MARSHAL m = new MARSHAL("Can't read an instance of "
               + clz.getName());
+            m.minor = Minor.Value;
             m.initCause(ex);
             throw m;
           }
Index: gnu/CORBA/DynAn/gnuDynValue.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/DynAn/gnuDynValue.java,v
retrieving revision 1.2
diff -u -r1.2 gnuDynValue.java
--- gnu/CORBA/DynAn/gnuDynValue.java    28 Aug 2005 11:23:36 -0000      1.2
+++ gnu/CORBA/DynAn/gnuDynValue.java    4 Oct 2005 15:24:40 -0000
@@ -38,6 +38,7 @@
 
 package gnu.CORBA.DynAn;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.Unexpected;
 
 import org.omg.CORBA.Any;
@@ -301,9 +302,12 @@
             ValueFactory factory =
               ((org.omg.CORBA_2_3.ORB) 
orb).lookup_value_factory(official_type.id());
             if (factory == null)
-              throw new MARSHAL("Factory for " + official_type.id() +
-                " not registered."
-              );
+              {
+                MARSHAL m = new MARSHAL("Factory for " + official_type.id() +
+                " not registered.");
+                m.minor = Minor.Factory;
+                throw m;
+              }
 
             OutputStream out = orb.create_output_stream();
 
Index: gnu/CORBA/GIOP/CloseMessage.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/GIOP/CloseMessage.java,v
retrieving revision 1.2
diff -u -r1.2 CloseMessage.java
--- gnu/CORBA/GIOP/CloseMessage.java    2 Jul 2005 20:32:09 -0000       1.2
+++ gnu/CORBA/GIOP/CloseMessage.java    4 Oct 2005 15:40:04 -0000
@@ -38,15 +38,13 @@
 
 package gnu.CORBA.GIOP;
 
-import gnu.CORBA.IOR;
+import gnu.CORBA.Minor;
 
 import org.omg.CORBA.MARSHAL;
 
 import java.io.IOException;
 import java.io.OutputStream;
 
-import java.net.Socket;
-
 /**
  * The explicit command to close the connection.
  *
@@ -60,6 +58,11 @@
 public class CloseMessage
   extends MessageHeader
 {
+  /** 
+   * Use serialVersionUID for interoperability. 
+   */
+  private static final long serialVersionUID = 1;
+  
   /**
    * The singleton close message is typically enough, despite new
    * instances may be instantiated if the specific version field
@@ -95,6 +98,7 @@
     catch (IOException ex)
       {
         MARSHAL m = new MARSHAL("Unable to flush the stream");
+        m.minor = Minor.Header;
         m.initCause(ex);
         throw m;
       }
Index: gnu/CORBA/GIOP/ErrorMessage.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/GIOP/ErrorMessage.java,v
retrieving revision 1.3
diff -u -r1.3 ErrorMessage.java
--- gnu/CORBA/GIOP/ErrorMessage.java    2 Jul 2005 20:32:09 -0000       1.3
+++ gnu/CORBA/GIOP/ErrorMessage.java    4 Oct 2005 14:05:10 -0000
@@ -39,6 +39,7 @@
 package gnu.CORBA.GIOP;
 
 import gnu.CORBA.IOR;
+import gnu.CORBA.Minor;
 
 import java.io.IOException;
 import java.io.OutputStream;
@@ -90,6 +91,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.Header;
         t.initCause(ex);
         throw t;
       }
Index: gnu/CORBA/GIOP/MessageHeader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/GIOP/MessageHeader.java,v
retrieving revision 1.6
diff -u -r1.6 MessageHeader.java
--- gnu/CORBA/GIOP/MessageHeader.java   2 Oct 2005 19:58:00 -0000       1.6
+++ gnu/CORBA/GIOP/MessageHeader.java   4 Oct 2005 15:28:06 -0000
@@ -38,6 +38,7 @@
 
 package gnu.CORBA.GIOP;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.Version;
 import gnu.CORBA.CDR.BigEndianInputStream;
 import gnu.CORBA.CDR.BigEndianOutputStream;
@@ -283,7 +284,11 @@
         byte[] xMagic = new byte[MAGIC.length];
         istream.read(xMagic);
         if (!Arrays.equals(xMagic, MAGIC))
-          throw new MARSHAL("Not a GIOP message");
+          {
+            MARSHAL m = new MARSHAL("Not a GIOP message");
+            m.minor = Minor.Giop;
+            throw m;
+          }
 
         version = Version.read_version(istream);
 
@@ -304,6 +309,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.Header;
         t.initCause(ex);
         throw t;
       }
@@ -349,6 +355,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.Header;
         t.initCause(ex);
         throw t;
       }
@@ -431,6 +438,7 @@
     catch (IOException ioex)
       {
         MARSHAL m = new MARSHAL("Unable to read the message continuation.");
+        m.minor = Minor.Header;
         m.initCause(ioex);
         throw m;
       }
Index: gnu/CORBA/GIOP/v1_2/RequestHeader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/GIOP/v1_2/RequestHeader.java,v
retrieving revision 1.3
diff -u -r1.3 RequestHeader.java
--- gnu/CORBA/GIOP/v1_2/RequestHeader.java      2 Jul 2005 20:32:09 -0000       
1.3
+++ gnu/CORBA/GIOP/v1_2/RequestHeader.java      4 Oct 2005 15:26:30 -0000
@@ -38,6 +38,7 @@
 
 package gnu.CORBA.GIOP.v1_2;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.CDR.cdrInput;
 import gnu.CORBA.CDR.cdrOutput;
 import gnu.CORBA.GIOP.ServiceContext;
@@ -58,6 +59,11 @@
 public class RequestHeader
   extends gnu.CORBA.GIOP.v1_0.RequestHeader
 {
+  /** 
+   * Use serialVersionUID for interoperability. 
+   */
+  private static final long serialVersionUID = 1;
+  
   /**
    * Indicates that the object is addressed by the object key.
    */
@@ -150,9 +156,11 @@
               throw new NO_IMPLEMENT("Object addressing by by IOR addressing 
info");
 
             default :
-              throw new MARSHAL("Unknow addressing method in request, " +
+              MARSHAL m = new MARSHAL("Unknow addressing method in request, " +
                                 AddressingDisposition
                                );
+              m.minor = Minor.UnsupportedAddressing;
+              throw m;
           }
 
         operation = in.read_string();
@@ -164,6 +172,7 @@
     catch (IOException ex)
       {
         MARSHAL t = new MARSHAL();
+        t.minor = Minor.Header;
         t.initCause(ex);
         throw t;
       }
Index: gnu/CORBA/Poa/ForwardedServant.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Poa/ForwardedServant.java,v
retrieving revision 1.1
diff -u -r1.1 ForwardedServant.java
--- gnu/CORBA/Poa/ForwardedServant.java 22 Jul 2005 16:57:47 -0000      1.1
+++ gnu/CORBA/Poa/ForwardedServant.java 4 Oct 2005 14:07:38 -0000
@@ -41,6 +41,7 @@
 import gnu.CORBA.IOR;
 import gnu.CORBA.IOR_Delegate;
 import gnu.CORBA.IOR_contructed_object;
+import gnu.CORBA.Minor;
 
 import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.CompletionStatus;
@@ -175,6 +176,7 @@
         catch (IOException io_ex)
           {
             MARSHAL m = new MARSHAL();
+            m.minor = Minor.Forwarding;
             m.initCause(io_ex);
             throw m;
           }
Index: gnu/javax/rmi/CORBA/UtilDelegateImpl.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/javax/rmi/CORBA/UtilDelegateImpl.java,v
retrieving revision 1.3
diff -u -r1.3 UtilDelegateImpl.java
--- gnu/javax/rmi/CORBA/UtilDelegateImpl.java   2 Oct 2005 19:58:01 -0000       
1.3
+++ gnu/javax/rmi/CORBA/UtilDelegateImpl.java   4 Oct 2005 15:54:16 -0000
@@ -38,6 +38,7 @@
 
 package gnu.javax.rmi.CORBA;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.ObjectCreator;
 import gnu.CORBA.generalTypeCode;
 import gnu.CORBA.Poa.ORB_1_4;
@@ -217,6 +218,7 @@
                   {
                     MARSHAL m = new MARSHAL("Unable to instantiate "
                       + tieClassName);
+                    m.minor = Minor.TargetConversion;
                     m.initCause(e);
                     throw m;
                   }
@@ -681,8 +683,12 @@
         output.write_any(any);
       }
     else
-      throw new MARSHAL(object.getClass().getName()
-        + " must be CORBA Object, Remote or Serializable");
+      {
+        MARSHAL m = new MARSHAL(object.getClass().getName()
+          + " must be CORBA Object, Remote or Serializable");
+        m.minor = Minor.NonSerializable;
+        throw m;
+      }
   }
 
   /**
Index: gnu/javax/rmi/CORBA/corbaObjectOutput.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/javax/rmi/CORBA/corbaObjectOutput.java,v
retrieving revision 1.2
diff -u -r1.2 corbaObjectOutput.java
--- gnu/javax/rmi/CORBA/corbaObjectOutput.java  2 Oct 2005 20:46:30 -0000       
1.2
+++ gnu/javax/rmi/CORBA/corbaObjectOutput.java  4 Oct 2005 15:51:06 -0000
@@ -1,39 +1,39 @@
 /* corbaObjectOutput.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005 Free Software Foundation, Inc.
 
- This file is part of GNU Classpath.
+This file is part of GNU Classpath.
 
- GNU Classpath is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU Classpath is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Classpath; see the file COPYING.  If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library.  Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module.  An independent module is a module which is not derived from
- or based on this library.  If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so.  If you do not wish to do so, delete this
- exception statement from your version. */
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
 
 
 package gnu.javax.rmi.CORBA;
Index: gnu/javax/rmi/CORBA/gnuRmiUtil.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/rmi/CORBA/gnuRmiUtil.java,v
retrieving revision 1.2
diff -u -r1.2 gnuRmiUtil.java
--- gnu/javax/rmi/CORBA/gnuRmiUtil.java 2 Oct 2005 20:24:18 -0000       1.2
+++ gnu/javax/rmi/CORBA/gnuRmiUtil.java 4 Oct 2005 15:54:16 -0000
@@ -39,6 +39,7 @@
 package gnu.javax.rmi.CORBA;
 
 import gnu.CORBA.Functional_ORB;
+import gnu.CORBA.Minor;
 import gnu.CORBA.Unexpected;
 import gnu.CORBA.CDR.Vio;
 import gnu.CORBA.CDR.gnuRuntime;
@@ -209,6 +210,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL("Cannot write " + object);
+        m.minor = Minor.ValueFields;
         m.initCause(ex);
         throw m;
       }
@@ -246,7 +248,11 @@
           output.write_value((Serializable) object, xClass);
       }
     else
-      throw new MARSHAL(xClass + " is not Serializable");
+      {
+        MARSHAL m = new MARSHAL(xClass + " is not Serializable");
+        m.minor = Minor.NonSerializable;
+        throw m;
+      }
   }
 
   /**
@@ -275,13 +281,21 @@
               if (fc == null)
                 fc = interfaces[i];
               else
-                throw new MARSHAL("Both " + fc + " and " + interfaces[i]
+                {
+                  MARSHAL m = new MARSHAL("Both " + fc + " and " + 
interfaces[i]
                   + " extends Remote");
+                  m.minor = Minor.TargetConversion;
+                  throw m;
+                }
             }
       }
     if (fc == null)
-      throw new MARSHAL(object.getClass()
+      {
+        MARSHAL m = new MARSHAL(object.getClass()
         + " does not implement any interface, derived from Remote");
+        m.minor = Minor.TargetConversion;
+        throw m;
+      }
     return fc;
   }
 
@@ -500,6 +514,7 @@
     catch (Exception ex)
       {
         MARSHAL m = new MARSHAL("Unable to export " + implementation);
+        m.minor = Minor.TargetConversion;
         m.initCause(ex);
         throw m;
       }
@@ -583,6 +598,7 @@
         catch (Exception ex)
           {
             MARSHAL m = new MARSHAL("writeExternal failed");
+            m.minor = Minor.Value;
             m.initCause(ex);
             throw m;
           }
@@ -715,6 +731,7 @@
             {
               MARSHAL m = new MARSHAL("Cannot get stub from interface "
                 + clz.getClass().getName());
+              m.minor = Minor.TargetConversion;
               m.initCause(e);
               throw m;
             }
@@ -841,6 +858,7 @@
     catch (Exception e)
       {
         MARSHAL m = new MARSHAL("Unable to instantiate " + clz);
+        m.minor = Minor.Instantiation;
         m.initCause(e);
         throw m;
       }
@@ -913,7 +931,7 @@
         MARSHAL m = new MARSHAL("Cannot read " + o_class.getName() + " field "
           + f);
         m.initCause(ex);
-        m.printStackTrace();
+        m.minor = Minor.ValueFields;
         throw m;
       }
   }
Index: org/omg/CORBA/MARSHAL.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/MARSHAL.java,v
retrieving revision 1.4
diff -u -r1.4 MARSHAL.java
--- org/omg/CORBA/MARSHAL.java  2 Jul 2005 20:32:57 -0000       1.4
+++ org/omg/CORBA/MARSHAL.java  4 Oct 2005 17:30:10 -0000
@@ -1,39 +1,39 @@
 /* MARSHAL.java --
-   Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005 Free Software Foundation, Inc.
 
-This file is part of GNU Classpath.
+ This file is part of GNU Classpath.
 
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING.  If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library.  Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module.  An independent module is a module which is not derived from
+ or based on this library.  If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so.  If you do not wish to do so, delete this
+ exception statement from your version. */
 
 
 package org.omg.CORBA;
@@ -41,8 +41,230 @@
 import java.io.Serializable;
 
 /**
- * Means that some request or reply from the network has a wrong
- * size or is structurally invalid.
+ * Means that some request or reply from the network has a wrong size or is
+ * structurally invalid. In GNU Classpath, this exception may have the 
following
+ * minor codes (the high 20 bits being Classpath VMCID):
+ * 
+ * <table border="1">
+ * <tr>
+ * <th>Hex</th>
+ * <th>Dec</th>
+ * <th>Minor</th>
+ * <th>Name</th>
+ * <th>Case</th>
+ * </tr>
+ * <tr>
+ * <td>47430001</td>
+ * <td>1195573249</td>
+ * <td>1</td>
+ * <td>Giop</td>
+ * <td>The message being received is not a GIOP message. It does not start from
+ * the expected magic sequence byte[] { 'G', 'I', 'O', 'P' }.</td>
+ * </tr>
+ * <tr>
+ * <td>47430002</td>
+ * <td>1195573250</td>
+ * <td>2</td>
+ * <td>Header</td>
+ * <td>The unexpected IOException while reading or writing the GIOP message
+ * header or the subsequent request or response header</td>
+ * </tr>
+ * <tr>
+ * <td>47430003</td>
+ * <td>1195573251</td>
+ * <td>3</td>
+ * <td>EOF</td>
+ * <td>The data stream ended before reading all expected values from it. This
+ * usually means that the CORBA message is corrupted, but may also indicate 
that
+ * the server expects the remote method being invoked to have more or different
+ * parameters</td>
+ * </tr>
+ * <tr>
+ * <td>47430005</td>
+ * <td>1195573253</td>
+ * <td>5</td>
+ * <td>CDR</td>
+ * <td>The unexpected IOException while reading or writing the data via Commond
+ * Data Representation stream</td>
+ * </tr>
+ * <tr>
+ * <td>47430006</td>
+ * <td>1195573254 </td>
+ * <td>6</td>
+ * <td>Value</td>
+ * <td>The unexpected IOException while reading or writing the Value type.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>47430007 </td>
+ * <td>1195573255</td>
+ * <td>7</td>
+ * <td>Forwarding</td>
+ * <td>The unexpected IOException while handling request forwarding.</td>
+ * </tr>
+ * <tr>
+ * <td>47430008</td>
+ * <td>1195573256</td>
+ * <td>8</td>
+ * <td>Encapsulation </td>
+ * <td>The unexpected IOException while handling data encapsulation, tagged
+ * components, tagged profiles, etc.</td>
+ * </tr>
+ * <tr>
+ * <td>47430009</td>
+ * <td>1195573257</td>
+ * <td>9 </td>
+ * <td>Any</td>
+ * <td>The unexpected IOException while inserting or extracting data to/from
+ * the Any.</td>
+ * </tr>
+ * <tr>
+ * <td>4743000a</td>
+ * <td>1195573258 </td>
+ * <td>10</td>
+ * <td>UserException</td>
+ * <td>The unexpected UserException in the context where it cannot be handled
+ * as such and must be converted to the SystemException. </td>
+ * </tr>
+ * <tr>
+ * <td>4743000b</td>
+ * <td>1195573259</td>
+ * <td>11</td>
+ * <td>Inappropriate</td>
+ * <td>While the operation could formally be applied to the target, the OMG
+ * standard states that it is actually not applicable. For example, some CORBA
+ * objects like POA are always local and should not be passed to or returned
+ * from the remote side.</td>
+ * </tr>
+ * <tr>
+ * <td>4743000c</td>
+ * <td>1195573260</td>
+ * <td>12</td>
+ * <td>Negative</td>
+ * <td>When reading data, it was discovered that size of the data structure
+ * like string, sequence or character is written as the negative number.</td>
+ * </tr>
+ * <tr>
+ * <td>4743000e</td>
+ * <td>1195573262 </td>
+ * <td>14</td>
+ * <td>Graph</td>
+ * <td>Reference to non-existing node in the data grapth while reading the
+ * value types.</td>
+ * </tr>
+ * <tr>
+ * <td>4743000f</td>
+ * <td>1195573263</td>
+ * <td>15</td>
+ * <td>Boxed</td>
+ * <td>Unexpected exception was thrown from the IDL type helper while handling
+ * the object of this type as a boxed value.</td>
+ * </tr>
+ * <tr>
+ * <td>47430010</td>
+ * <td>1195573264</td>
+ * <td>16</td>
+ * <td>Instantiation</td>
+ * <td>Unable to instantiate an value type object while reading it from the
+ * stream.</td>
+ * </tr>
+ * <tr>
+ * <td>47430011</td>
+ * <td>1195573265</td>
+ * <td>17</td>
+ * <td>ValueHeaderTag</td>
+ * <td>The header tag of the value type being read from the CDR stream contains
+ * an unexpected value outside 0x7fffff00 .. 0x7fffffff and also not null and
+ * not an indirection.</td>
+ * </tr>
+ * <tr>
+ * <td>47430012</td>
+ * <td>1195573266</td>
+ * <td>18</td>
+ * <td>ValueHeaderFlags</td>
+ * <td>The header tag flags of the value type being read from the CDR stream
+ * make the invalid combination (for instance, 0x7fffff04).</td>
+ * </tr>
+ * <tr>
+ * <td>47430013</td>
+ * <td>1195573267</td>
+ * <td>19</td>
+ * <td>ClassCast</td>
+ * <td>The value type class, written on the wire, is not compatible with the
+ * expected class, passed as a parameter to the InputStream.read_value.</td>
+ * </tr>
+ * <tr>
+ * <td>47430014</td>
+ * <td>1195573268</td>
+ * <td>20</td>
+ * <td>Offset</td>
+ * <td>Positive or otherwise invalid indirection offset when reading the data
+ * graph of the value type.</td>
+ * </tr>
+ * <tr>
+ * <td>47430015</td>
+ * <td>1195573269</td>
+ * <td>21</td>
+ * <td>Chunks</td>
+ * <td>Errors while reading the chunked value type.</td>
+ * </tr>
+ * <tr>
+ * <td>47430016</td>
+ * <td>1195573270</td>
+ * <td>22</td>
+ * <td>UnsupportedValue</td>
+ * <td>No means are provided to read or write this value type (not Streamable,
+ * not CustomMarshal, not Serializable, no factory, no helper.</td>
+ * </tr>
+ * <tr> 
+ * <td>47430017</td>
+ * <td>1195573271</td>
+ * <td>23</td>
+ * <td>Factory</td>
+ * <td>The value factory, required for the operation being invoked, is not
+ * registered with this ORB.</td>
+ * </tr>
+ * <tr>
+ * <td>47430018</td>
+ * <td>1195573272</td>
+ * <td>24</td>
+ * 
+ * <td>UnsupportedAddressing</td>
+ * <td>Unsupported object addressing method in GIOP request header.</td>
+ * </tr>
+ * <tr>
+ * <td>47430019</td>
+ * <td>1195573273</td>
+ * <td>25</td>
+ * <td>IOR</td>
+ * <td>Invalid object reference (IOR).</td>
+ * </tr>
+ * <tr>
+ * <td>4743001a</td>
+ * <td>1195573274</td>
+ * <td>26</td>
+ * <td>TargetConversion</td>
+ * <td>Problems with converting between stubs, ties, interfaces and
+ * implementations.</td>
+ * 
+ * </tr>
+ * <tr>
+ * <td>4743001b</td>
+ * <td>1195573275</td>
+ * <td>27</td>
+ * <td>ValueFields</td>
+ * <td>Problems with reading or writing the fields of the value type object
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>4743001c</td>
+ * <td>1195573276</td>
+ * <td>28</td>
+ * <td>NonSerializable</td>
+ * <td>The instance of the value type, passed using RMI over IIOP, is not
+ * serializable</td>
+ * </tr>
+ * </table>
  * 
  * @author Audrius Meskauskas (address@hidden)
  */
@@ -50,14 +272,15 @@
   extends SystemException
   implements Serializable
 {
-  /** 
+  /**
    * Use serialVersionUID for interoperability.
    */
   private static final long serialVersionUID = 7416408250336395546L;
 
   /**
-   * Creates a MARSHAL with the default minor code of 0,
-   * completion state COMPLETED_NO and the given explaining message.
+   * Creates a MARSHAL with the default minor code of 0, completion state
+   * COMPLETED_NO and the given explaining message.
+   * 
    * @param reasom the explaining message.
    */
   public MARSHAL(String message)
@@ -66,32 +289,35 @@
   }
 
   /**
-   * Creates MARSHAL with the default minor code of 0 and a
-   * completion state COMPLETED_NO.
+   * Creates MARSHAL with the default minor code of 0 and a completion state
+   * COMPLETED_NO.
    */
   public MARSHAL()
   {
     super("", 0, CompletionStatus.COMPLETED_NO);
   }
 
-  /** Creates a MARSHAL exception with the specified minor
-   * code and completion status.
-   * @param minor additional error code.
-   * @param completed the method completion status.
+  /**
+   * Creates a MARSHAL exception with the specified minor code and completion
+   * status.
+   * 
+   * @param minor_code additional error code.
+   * @param is_completed the method completion status.
    */
-  public MARSHAL(int minor, CompletionStatus completed)
+  public MARSHAL(int minor_code, CompletionStatus is_completed)
   {
-    super("", minor, completed);
+    super("", minor_code, is_completed);
   }
 
   /**
    * Created MARSHAL exception, providing full information.
+   * 
    * @param reason explaining message.
-   * @param minor additional error code (the "minor").
-   * @param completed the method completion status.
+   * @param minor_code additional error code (the "minor").
+   * @param is_completed the method completion status.
    */
-  public MARSHAL(String reason, int minor, CompletionStatus completed)
+  public MARSHAL(String reason, int minor_code, CompletionStatus is_completed)
   {
-    super(reason, minor, completed);
+    super(reason, minor_code, is_completed);
   }
 }
Index: org/omg/CORBA/StringValueHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/StringValueHelper.java,v
retrieving revision 1.3
diff -u -r1.3 StringValueHelper.java
--- org/omg/CORBA/StringValueHelper.java        2 Oct 2005 19:58:01 -0000       
1.3
+++ org/omg/CORBA/StringValueHelper.java        4 Oct 2005 15:42:44 -0000
@@ -38,6 +38,7 @@
 
 package org.omg.CORBA;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.Restricted_ORB;
 
 import org.omg.CORBA.portable.BoxedValueHelper;
@@ -119,7 +120,9 @@
       }
     catch (ClassCastException ex)
       {
-        throw new MARSHAL("String expected");
+        MARSHAL m = new MARSHAL("String expected");
+        m.minor = Minor.ClassCast;
+        throw m;
       }
   }
 
Index: org/omg/CORBA/StructMemberHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/StructMemberHelper.java,v
retrieving revision 1.2
diff -u -r1.2 StructMemberHelper.java
--- org/omg/CORBA/StructMemberHelper.java       2 Jul 2005 20:32:57 -0000       
1.2
+++ org/omg/CORBA/StructMemberHelper.java       4 Oct 2005 14:16:26 -0000
@@ -38,6 +38,7 @@
 
 package org.omg.CORBA;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.Restricted_ORB;
 import gnu.CORBA.TypeCodeHelper;
 
@@ -151,6 +152,7 @@
     catch (UserException ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.UserException;
         m.initCause(ex);
         throw m;
       }
@@ -170,6 +172,7 @@
     catch (UserException ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.UserException;
         m.initCause(ex);
         throw m;
       }
Index: org/omg/CORBA/SystemException.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/SystemException.java,v
retrieving revision 1.7
diff -u -r1.7 SystemException.java
--- org/omg/CORBA/SystemException.java  2 Oct 2005 19:58:01 -0000       1.7
+++ org/omg/CORBA/SystemException.java  4 Oct 2005 17:37:20 -0000
@@ -63,20 +63,16 @@
    * <p>
    * Contains more details about the exception. The lower 12 bits contain a
    * code, defining the reason why exception has been thrown. The higher 20 
bits
-   * hold "Vendor Minor Codeset ID" (VMCID), for instance 0x4F4D0000 (OMG
-   * standard), 0x54410000 (TAO), 0x4A430000 (JacORB), 0x49540000 (IONA) or
-   * 0x53550000 (Sun).
+   * hold "Vendor Minor Codeset ID" (VMCID).
    * </p>
-   * 
    * <p>
-   * The standard minor codes for the standard system exceptions are prefaced 
by
-   * the VMCID assigned to OMG, defined as 0x4F4D0000 (the code of
-   * the minor field for the standard exception with minor code 1 is
-   * 0x4F4D0001). Within a vendor assigned space, the assignment of values to
-   * minor codes is left to the vendor.
+   * The Classpath specifice minor exception codes are documented in the 
headers
+   * of the corresponding exceptions (for instance, address@hidden MARSHAL}).
    * </p>
    * 
    * The VMCID 0 and 0xfffff are reserved for experimental use. 
+   * 
+   * @see OMGVMCID
    */
   public int minor;
 
@@ -91,7 +87,8 @@
   protected SystemException(String a_reason, int a_minor,
                             CompletionStatus a_completed)
   {
-    super(a_reason);
+    super(a_reason + " Minor: " + Integer.toHexString(a_minor) + " ("
+      + (a_minor & 0xFFF) + "). Completed: "+a_completed);
     minor = a_minor;
     completed = a_completed;
   }
Index: org/omg/CORBA/UnionMemberHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/UnionMemberHelper.java,v
retrieving revision 1.2
diff -u -r1.2 UnionMemberHelper.java
--- org/omg/CORBA/UnionMemberHelper.java        2 Jul 2005 20:32:58 -0000       
1.2
+++ org/omg/CORBA/UnionMemberHelper.java        4 Oct 2005 14:30:00 -0000
@@ -38,6 +38,7 @@
 
 package org.omg.CORBA;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.Restricted_ORB;
 import gnu.CORBA.TypeCodeHelper;
 
@@ -152,6 +153,7 @@
     catch (UserException ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.UserException;
         m.initCause(ex);
         throw m;
       }
@@ -172,6 +174,7 @@
     catch (UserException ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.UserException;        
         m.initCause(ex);
         throw m;
       }
Index: org/omg/CORBA/ValueMemberHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/ValueMemberHelper.java,v
retrieving revision 1.2
diff -u -r1.2 ValueMemberHelper.java
--- org/omg/CORBA/ValueMemberHelper.java        2 Jul 2005 20:32:58 -0000       
1.2
+++ org/omg/CORBA/ValueMemberHelper.java        4 Oct 2005 14:17:24 -0000
@@ -38,6 +38,7 @@
 
 package org.omg.CORBA;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.Restricted_ORB;
 import gnu.CORBA.TypeCodeHelper;
 
@@ -177,6 +178,7 @@
     catch (UserException ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.UserException;        
         m.initCause(ex);
         throw m;
       }
@@ -200,6 +202,7 @@
     catch (UserException ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.UserException;        
         m.initCause(ex);
         throw m;
       }
Index: org/omg/CORBA/WStringValueHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/WStringValueHelper.java,v
retrieving revision 1.3
diff -u -r1.3 WStringValueHelper.java
--- org/omg/CORBA/WStringValueHelper.java       2 Oct 2005 19:58:01 -0000       
1.3
+++ org/omg/CORBA/WStringValueHelper.java       4 Oct 2005 15:43:04 -0000
@@ -38,6 +38,7 @@
 
 package org.omg.CORBA;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.Restricted_ORB;
 
 import org.omg.CORBA.portable.BoxedValueHelper;
@@ -119,7 +120,9 @@
       }
     catch (ClassCastException ex)
       {
-        throw new MARSHAL("String expected");
+        MARSHAL m = new MARSHAL("String expected");
+        m.minor = Minor.ClassCast;
+        throw m;
       }
   }
 
Index: org/omg/CORBA/_IDLTypeStub.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/_IDLTypeStub.java,v
retrieving revision 1.3
diff -u -r1.3 _IDLTypeStub.java
--- org/omg/CORBA/_IDLTypeStub.java     2 Jul 2005 20:32:58 -0000       1.3
+++ org/omg/CORBA/_IDLTypeStub.java     4 Oct 2005 14:15:48 -0000
@@ -38,6 +38,7 @@
 
 package org.omg.CORBA;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.TypeCodeHelper;
 
 import org.omg.CORBA.portable.ApplicationException;
@@ -114,6 +115,7 @@
     catch (UserException ex)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.UserException;
         m.initCause(ex);
         throw m;
       }
Index: org/omg/DynamicAny/DynAnyFactoryHelper.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java,v
retrieving revision 1.2
diff -u -r1.2 DynAnyFactoryHelper.java
--- org/omg/DynamicAny/DynAnyFactoryHelper.java 7 Aug 2005 17:17:43 -0000       
1.2
+++ org/omg/DynamicAny/DynAnyFactoryHelper.java 4 Oct 2005 14:22:52 -0000
@@ -39,6 +39,8 @@
 
 package org.omg.DynamicAny;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.TypeCode;
 import org.omg.CORBA.ORB;
@@ -161,13 +163,8 @@
    */
   static String not_applicable(String Id)
   {
-    try
-      {
-        throw new MARSHAL("The read/write are not applicable for " + Id);
-      }
-    catch (Exception e)
-      {
-        throw new MARSHAL();
-      }
+    MARSHAL m = new MARSHAL("The read/write are not applicable for " + Id);
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 }
Index: org/omg/DynamicAny/_DynAnyFactoryStub.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java,v
retrieving revision 1.4
diff -u -r1.4 _DynAnyFactoryStub.java
--- org/omg/DynamicAny/_DynAnyFactoryStub.java  28 Aug 2005 11:23:36 -0000      
1.4
+++ org/omg/DynamicAny/_DynAnyFactoryStub.java  4 Oct 2005 15:48:32 -0000
@@ -38,6 +38,8 @@
 
 package org.omg.DynamicAny;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.Any;
 import org.omg.CORBA.MARSHAL;
 import org.omg.CORBA.TypeCode;
@@ -101,7 +103,9 @@
   public DynAny create_dyn_any(Any _0)
                         throws InconsistentTypeCode
   {
-    throw new MARSHAL(NOT_APPLICABLE);
+    MARSHAL m = new MARSHAL(NOT_APPLICABLE);
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 
   /**
@@ -113,7 +117,9 @@
   public DynAny create_dyn_any_from_type_code(TypeCode _0)
                                        throws InconsistentTypeCode
   {
-    throw new MARSHAL(NOT_APPLICABLE);
+    MARSHAL m = new MARSHAL(NOT_APPLICABLE);
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 
   static String NOT_APPLICABLE =
Index: org/omg/IOP/TaggedComponentHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/IOP/TaggedComponentHelper.java,v
retrieving revision 1.3
diff -u -r1.3 TaggedComponentHelper.java
--- org/omg/IOP/TaggedComponentHelper.java      28 Aug 2005 11:23:36 -0000      
1.3
+++ org/omg/IOP/TaggedComponentHelper.java      4 Oct 2005 14:25:58 -0000
@@ -38,6 +38,8 @@
 
 package org.omg.IOP;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.Any;
 import org.omg.CORBA.BAD_OPERATION;
 import org.omg.CORBA.MARSHAL;
@@ -149,6 +151,7 @@
     catch (IOException e)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.Encapsulation;
         m.initCause(e);
         throw m;
       }
@@ -175,6 +178,7 @@
     catch (IOException e)
       {
         MARSHAL m = new MARSHAL();
+        m.minor = Minor.Encapsulation;
         m.initCause(e);
         throw m;
       }
Index: org/omg/IOP/TaggedProfileHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/IOP/TaggedProfileHelper.java,v
retrieving revision 1.3
diff -u -r1.3 TaggedProfileHelper.java
--- org/omg/IOP/TaggedProfileHelper.java        28 Aug 2005 11:23:36 -0000      
1.3
+++ org/omg/IOP/TaggedProfileHelper.java        4 Oct 2005 14:27:02 -0000
@@ -38,6 +38,7 @@
 
 package org.omg.IOP;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.CDR.cdrBufInput;
 import gnu.CORBA.CDR.cdrBufOutput;
 
@@ -178,6 +179,7 @@
         catch (IOException e)
           {
             MARSHAL m = new MARSHAL();
+            m.minor = Minor.Encapsulation;
             m.initCause(e);
             throw m;
           }
Index: org/omg/PortableInterceptor/CurrentHelper.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/CurrentHelper.java,v
retrieving revision 1.1
diff -u -r1.1 CurrentHelper.java
--- org/omg/PortableInterceptor/CurrentHelper.java      28 Aug 2005 11:23:37 
-0000      1.1
+++ org/omg/PortableInterceptor/CurrentHelper.java      4 Oct 2005 14:28:04 
-0000
@@ -38,6 +38,8 @@
 
 package org.omg.PortableInterceptor;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.Any;
 import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.MARSHAL;
@@ -133,7 +135,9 @@
    */
   public static Current read(InputStream input)
   {
-    throw new MARSHAL();
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 
   /**
@@ -145,6 +149,8 @@
    */
   public static void write(OutputStream output, Current value)
   {
-    throw new MARSHAL();
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 }
Index: org/omg/PortableServer/POAHelper.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/omg/PortableServer/POAHelper.java,v
retrieving revision 1.2
diff -u -r1.2 POAHelper.java
--- org/omg/PortableServer/POAHelper.java       27 Jul 2005 15:58:29 -0000      
1.2
+++ org/omg/PortableServer/POAHelper.java       4 Oct 2005 15:48:32 -0000
@@ -38,6 +38,8 @@
 
 package org.omg.PortableServer;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.TypeCode;
 import org.omg.CORBA.ORB;
@@ -126,7 +128,9 @@
    */
   public static POA read(InputStream input)
   {
-    throw new MARSHAL("Not applicable");
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 
   /**
@@ -142,6 +146,8 @@
    */
   public static void write(OutputStream output, POA value)
   {
-    throw new MARSHAL("Not applicable");
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 }
Index: org/omg/PortableServer/ServantActivatorHelper.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableServer/ServantActivatorHelper.java,v
retrieving revision 1.2
diff -u -r1.2 ServantActivatorHelper.java
--- org/omg/PortableServer/ServantActivatorHelper.java  24 Aug 2005 22:57:08 
-0000      1.2
+++ org/omg/PortableServer/ServantActivatorHelper.java  4 Oct 2005 14:29:28 
-0000
@@ -38,6 +38,8 @@
 
 package org.omg.PortableServer;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.Any;
 import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.MARSHAL;
@@ -125,7 +127,9 @@
    */
   public static ServantActivator read(InputStream input)
   {
-    throw new MARSHAL();
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 
   /**
@@ -140,6 +144,8 @@
    */
   public static void write(OutputStream output, ServantActivator value)
   {
-    throw new MARSHAL();
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 }
Index: org/omg/PortableServer/ServantLocatorHelper.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableServer/ServantLocatorHelper.java,v
retrieving revision 1.2
diff -u -r1.2 ServantLocatorHelper.java
--- org/omg/PortableServer/ServantLocatorHelper.java    24 Aug 2005 22:57:08 
-0000      1.2
+++ org/omg/PortableServer/ServantLocatorHelper.java    4 Oct 2005 14:28:48 
-0000
@@ -38,6 +38,8 @@
 
 package org.omg.PortableServer;
 
+import gnu.CORBA.Minor;
+
 import org.omg.CORBA.Any;
 import org.omg.CORBA.BAD_OPERATION;
 import org.omg.CORBA.MARSHAL;
@@ -125,7 +127,9 @@
    */
   public static ServantLocator read(InputStream input)
   {
-    throw new MARSHAL();
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 
   /**
@@ -140,6 +144,8 @@
    */
   public static void write(OutputStream output, ServantLocator value)
   {
-    throw new MARSHAL();
+    MARSHAL m = new MARSHAL("Inappropriate");
+    m.minor = Minor.Inappropriate;
+    throw m;
   }
 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]