Issue 1242: Any"s and Exceptions (java-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: In Section 23.13, the signature for insert_Object() is given as, // throw excep when typecode inconsistent with value abstract public void insert_Object( org.omg.CORBA.Object o, org.omg.CORBA.TypeCode t) throws org.omg.CORBA.MARSHAL; Does this mean if an incorrect TypeCode is passed, eg. tk_short, that a MARSHAL Exception must be thrown or could a BAD_PARAM Exception be thrown. Also, I assume read_value() is meant to insert a complex IDL type into an Any ? If so, read_value() is supposed to throw a MARSHAL Exception if the typecode is inconsistent with the value. Does this mean that if a short has been written to the stream, but the stream is passed with a tk_sequence typecode, then an Exception should be thrown by read_value() ?. Resolution: closed issue Revised Text: Actions taken: April 27, 1998: received issue May 18, 1998: closed issue Discussion: End of Annotations:===== Return-Path: Date: Mon, 27 Apr 1998 14:53:59 +0100 From: Charlie Watson To: java-rtf@omg.org Subject: Any's and Exceptions In Section 23.13, the signature for insert_Object() is given as, // throw excep when typecode inconsistent with value abstract public void insert_Object( org.omg.CORBA.Object o, org.omg.CORBA.TypeCode t) throws org.omg.CORBA.MARSHAL; Does this mean if an incorrect TypeCode is passed, eg. tk_short, that a MARSHAL Exception must be thrown or could a BAD_PARAM Exception be thrown. Also, I assume read_value() is meant to insert a complex IDL type into an Any ? If so, read_value() is supposed to throw a MARSHAL Exception if the typecode is inconsistent with the value. Does this mean that if a short has been written to the stream, but the stream is passed with a tk_sequence typecode, then an Exception should be thrown by read_value() ? eg. Any a = orb.create_any(); OutputStream os = a.create_output_stream(); os.write_short((short) 5); InputStream is = os.create_input_stream(); TypeCode tc = orb.get_primitive_tc(TCKind.tk_float); a.read_value(is, orb.create_sequence_tc(5,tc)); Charles Watson Software Engineer ApTest Ireland.