TaggedComponentHelper.java (read): Use read_octet_array(), not read().
2007-04-16 Andrew Haley <aph@redhat.com> * org/omg/IOP/TaggedComponentHelper.java (read): Use read_octet_array(), not read(). (write): Use write_octet_array(), not write(). * org/omg/PortableServer/Servant.java (_get_delegate): Throw if no delegate has been set. * javax/management/ObjectName.java serialVersionUID: Declare. Make all fields transient. (parse): Break out from constructor. (writeObject, readObject): New methods. From-SVN: r123864
This commit is contained in:
committed by
Andrew Haley
parent
8dd58f012c
commit
2f69f684f3
@@ -136,18 +136,9 @@ public abstract class TaggedComponentHelper
|
||||
{
|
||||
TaggedComponent value = new TaggedComponent();
|
||||
value.tag = input.read_long();
|
||||
value.component_data = new byte[input.read_long()];
|
||||
try
|
||||
{
|
||||
input.read(value.component_data);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
MARSHAL m = new MARSHAL();
|
||||
m.minor = Minor.Encapsulation;
|
||||
m.initCause(e);
|
||||
throw m;
|
||||
}
|
||||
int length = input.read_long();
|
||||
value.component_data = new byte[length];
|
||||
input.read_octet_array(value.component_data, 0, length);
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -163,17 +154,6 @@ public abstract class TaggedComponentHelper
|
||||
{
|
||||
output.write_long(value.tag);
|
||||
output.write_long(value.component_data.length);
|
||||
|
||||
try
|
||||
{
|
||||
output.write(value.component_data);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
MARSHAL m = new MARSHAL();
|
||||
m.minor = Minor.Encapsulation;
|
||||
m.initCause(e);
|
||||
throw m;
|
||||
}
|
||||
output.write_octet_array(value.component_data, 0, value.component_data.length);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ exception statement from your version. */
|
||||
package org.omg.PortableServer;
|
||||
|
||||
import org.omg.CORBA.BAD_OPERATION;
|
||||
import org.omg.CORBA.BAD_INV_ORDER;
|
||||
import org.omg.CORBA.NO_IMPLEMENT;
|
||||
import org.omg.CORBA.OBJECT_NOT_EXIST;
|
||||
import org.omg.CORBA.ORB;
|
||||
@@ -109,6 +110,10 @@ public abstract class Servant
|
||||
*/
|
||||
public final Delegate _get_delegate()
|
||||
{
|
||||
if (delegate == null) {
|
||||
throw new BAD_INV_ORDER
|
||||
("The Servant has not been associated with an ORBinstance");
|
||||
}
|
||||
return delegate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user