diff options
author | Andrew Haley <aph@redhat.com> | 2007-04-16 13:46:54 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2007-04-16 13:46:54 +0000 |
commit | 2f69f684f3367f585a0f73e4308dc2449295a076 (patch) | |
tree | 25fb8793c54fb29772fd31b47d57b85b5d092932 /libjava/classpath/org | |
parent | 8dd58f012c09e98c63fe50d08f0e6e82edcc4270 (diff) | |
download | gcc-2f69f684f3367f585a0f73e4308dc2449295a076.zip gcc-2f69f684f3367f585a0f73e4308dc2449295a076.tar.gz gcc-2f69f684f3367f585a0f73e4308dc2449295a076.tar.bz2 |
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
Diffstat (limited to 'libjava/classpath/org')
-rw-r--r-- | libjava/classpath/org/omg/IOP/TaggedComponentHelper.java | 28 | ||||
-rw-r--r-- | libjava/classpath/org/omg/PortableServer/Servant.java | 5 |
2 files changed, 9 insertions, 24 deletions
diff --git a/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java b/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java index 633891b..55090c7 100644 --- a/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java +++ b/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java @@ -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); } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/Servant.java b/libjava/classpath/org/omg/PortableServer/Servant.java index 24eb715..fcb2cdd 100644 --- a/libjava/classpath/org/omg/PortableServer/Servant.java +++ b/libjava/classpath/org/omg/PortableServer/Servant.java @@ -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; } |