/[classpath]/classpath/gnu/CORBA/CDR/Vio.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/CDR/Vio.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by audriusa, Sun Oct 2 20:24:18 2005 UTC revision 1.7 by audriusa, Tue Oct 4 17:58:14 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package gnu.CORBA.CDR;  package gnu.CORBA.CDR;
40    
41    import gnu.CORBA.Minor;
42  import gnu.CORBA.ObjectCreator;  import gnu.CORBA.ObjectCreator;
43    
44  import org.omg.CORBA.CustomMarshal;  import org.omg.CORBA.CustomMarshal;
# Line 238  public abstract class Vio Line 239  public abstract class Vio
239      catch (Exception ex)      catch (Exception ex)
240        {        {
241          MARSHAL m = new MARSHAL();          MARSHAL m = new MARSHAL();
242            m.minor = Minor.Value;        
243          m.initCause(ex);          m.initCause(ex);
244          throw m;          throw m;
245        }        }
# Line 313  public abstract class Vio Line 315  public abstract class Vio
315                {                {
316                  if (value_class != null                  if (value_class != null
317                    && !value_class.isAssignableFrom(ox.getClass()))                    && !value_class.isAssignableFrom(ox.getClass()))
318                    throw new MARSHAL(ox.getClass() + " is not a "                    {
319                        MARSHAL m = new MARSHAL(ox.getClass() + " is not a "
320                      + value_class.getName());                      + value_class.getName());
321                        m.minor = Minor.ClassCast;
322                        throw m;
323                      }
324                }                }
325            }            }
326          else          else
# Line 331  public abstract class Vio Line 337  public abstract class Vio
337      catch (SystemException sysEx)      catch (SystemException sysEx)
338        {        {
339          // OK.          // OK.
         sysEx.printStackTrace();  
340          throw sysEx;          throw sysEx;
341        }        }
342      catch (Exception ex)      catch (Exception ex)
343        {        {
344          MARSHAL m = new MARSHAL("Cant read " + value_class);          MARSHAL m = new MARSHAL("Cant read " + value_class);
345            m.minor = Minor.Value;
346          m.initCause(ex);          m.initCause(ex);
347          throw m;          throw m;
348        }        }
# Line 414  public abstract class Vio Line 420  public abstract class Vio
420      catch (Exception ex)      catch (Exception ex)
421        {        {
422          MARSHAL m = new MARSHAL();          MARSHAL m = new MARSHAL();
423            m.minor = Minor.Value;
424          m.initCause(ex);          m.initCause(ex);
425          throw m;          throw m;
426        }        }
# Line 499  public abstract class Vio Line 506  public abstract class Vio
506                }                }
507            }            }
508        }        }
509      catch (Throwable ex)      catch (IOException ex)
510        {        {
         ex.printStackTrace();  
511          MARSHAL m = new MARSHAL("Unable to read chunks");          MARSHAL m = new MARSHAL("Unable to read chunks");
512            m.minor = Minor.Value;
513          m.initCause(ex);          m.initCause(ex);
514          throw m;          throw m;
515        }        }
# Line 555  public abstract class Vio Line 562  public abstract class Vio
562    
563          // The nested value should be aways chunked.          // The nested value should be aways chunked.
564          if ((value_tag & vf_CHUNKING) == 0)          if ((value_tag & vf_CHUNKING) == 0)
565            throw new MARSHAL("readNestedValue: must be chunked");            {
566                MARSHAL m = new MARSHAL("readNestedValue: must be chunked");
567                m.minor = Minor.Chunks;
568                throw m;
569              }
570          else if (value_tag == vt_NULL)          else if (value_tag == vt_NULL)
571            throw new MARSHAL("readNestedValue: null");            {
572                MARSHAL m = new MARSHAL("readNestedValue: nul");
573                m.minor = Minor.Chunks;
574                throw m;
575              }
576          else if (value_tag == vt_INDIRECTION)          else if (value_tag == vt_INDIRECTION)
577            throw new MARSHAL("readNestedValue: indirection");            {
578                MARSHAL m = new MARSHAL("readNestedValue: indirection");
579                m.minor = Minor.Chunks;
580                throw m;
581              }
582          else          else
583            {            {
584              // Read the value.              // Read the value.
# Line 709  public abstract class Vio Line 728  public abstract class Vio
728      if (!ok)      if (!ok)
729        {        {
730          if (value != null)          if (value != null)
731            throw new MARSHAL(value.getClass().getName()            {
732                MARSHAL m = new MARSHAL(value.getClass().getName()
733              + " must be Streamable, CustomMarshal or Serializable");              + " must be Streamable, CustomMarshal or Serializable");
734                m.minor = Minor.UnsupportedValue;
735                throw m;
736              }
737          else          else
738            throw new MARSHAL("Unable to instantiate " + id + ":" + list(ids)            {
739                MARSHAL m = new MARSHAL("Unable to instantiate " + id + ":" + list(ids)
740              + " helper " + helper);              + " helper " + helper);
741                m.minor = Minor.UnsupportedValue;
742                throw m;
743              }
744        }        }
745      else      else
746        return (Serializable) value;        return (Serializable) value;
# Line 906  public abstract class Vio Line 933  public abstract class Vio
933              else if (runtime.target == value)              else if (runtime.target == value)
934                {                {
935                  if (!writeSelf(output, value))                  if (!writeSelf(output, value))
936                    throw new MARSHAL("Recursive helper call for "                    throw new InternalError("Recursive helper call for "
937                      + value.getClass().getName());                      + value.getClass().getName());
938                  return;                  return;
939                }                }
# Line 1057  public abstract class Vio Line 1084  public abstract class Vio
1084    
1085      int offset = an_input.read_long();      int offset = an_input.read_long();
1086      if (offset > -INT_SIZE)      if (offset > -INT_SIZE)
1087        throw new MARSHAL("Indirection tag refers to " + offset        {
1088            MARSHAL m = new MARSHAL("Indirection tag refers to " + offset
1089          + " (must be less than -" + INT_SIZE + ")");          + " (must be less than -" + INT_SIZE + ")");
1090            m.minor = Minor.Offset;
1091            throw m;
1092          }
1093    
1094      int stored_at = current_pos + offset;      int stored_at = current_pos + offset;
1095    
1096      if (in.getRunTime() == null)      if (in.getRunTime() == null)
1097        throw new MARSHAL(stored_at + " offset " + offset + ": not written");        {
1098            MARSHAL m = new MARSHAL(stored_at + " offset " + offset + ": not written");
1099            m.minor = Minor.Value;
1100            throw m;
1101          }
1102    
1103      return (Serializable) in.getRunTime().isObjectWrittenAt(stored_at, offset);      return (Serializable) in.getRunTime().isObjectWrittenAt(stored_at, offset);
1104    }    }
# Line 1079  public abstract class Vio Line 1114  public abstract class Vio
1114    {    {
1115      if ((value_tag < 0x7fffff00 || value_tag > 0x7fffffff)      if ((value_tag < 0x7fffff00 || value_tag > 0x7fffffff)
1116        && value_tag != vt_NULL && value_tag != vt_INDIRECTION)        && value_tag != vt_NULL && value_tag != vt_INDIRECTION)
1117        throw new MARSHAL("Invalid value record, unsupported header tag: "        {
1118            MARSHAL m = new MARSHAL("Invalid value record, unsupported header tag: "
1119          + value_tag + " (0x" + Integer.toHexString(value_tag) + ")");          + value_tag + " (0x" + Integer.toHexString(value_tag) + ")");
1120            m.minor = Minor.ValueHeaderTag;
1121            throw m;
1122          }
1123    
1124      if ((value_tag & vf_MULTIPLE_IDS) != 0 && (value_tag & vf_ID) == 0)      if ((value_tag & vf_MULTIPLE_IDS) != 0 && (value_tag & vf_ID) == 0)
1125        throw new MARSHAL("Invalid value record header flag combination (0x"        {
1126            MARSHAL m = new MARSHAL("Invalid value record header flag combination (0x"
1127          + Integer.toHexString(value_tag) + ")");          + Integer.toHexString(value_tag) + ")");
1128            m.minor = Minor.ValueHeaderFlags;
1129            throw m;
1130          }
1131    }    }
1132    
1133    /**    /**
# Line 1096  public abstract class Vio Line 1139  public abstract class Vio
1139      MARSHAL m = new MARSHAL(msg + ":'" + id1 + "' versus '" + id2 + "'");      MARSHAL m = new MARSHAL(msg + ":'" + id1 + "' versus '" + id2 + "'");
1140      if (e != null)      if (e != null)
1141        m.initCause(e);        m.initCause(e);
1142        m.minor = Minor.Value;
1143      throw m;      throw m;
1144    }    }
1145    
# Line 1177  public abstract class Vio Line 1221  public abstract class Vio
1221          catch (Exception ex)          catch (Exception ex)
1222            {            {
1223              MARSHAL m = new MARSHAL("Unable to instantiate " + id);              MARSHAL m = new MARSHAL("Unable to instantiate " + id);
1224                m.minor = Minor.Instantiation;
1225              m.initCause(ex);              m.initCause(ex);
1226              throw m;              throw m;
1227            }            }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26