diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 21:31:04 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 21:31:04 +0000 |
| commit | 947b8814056ea2fba6bbcfab86591f74bffc0311 (patch) | |
| tree | 3ca4b2e68dc14c3128b9c781d23f1d0b1f2bee49 /libjava/classpath/gnu/CORBA/gnuAny.java | |
| parent | 49792907376493f0939563eb0219b96a48f1ae3b (diff) | |
| download | ppe42-gcc-947b8814056ea2fba6bbcfab86591f74bffc0311.tar.gz ppe42-gcc-947b8814056ea2fba6bbcfab86591f74bffc0311.zip | |
Imported Classpath 0.18.
* sources.am, Makefile.in: Updated.
* Makefile.am (nat_source_files): Removed natProxy.cc.
* java/lang/reflect/natProxy.cc: Removed.
* gnu/classpath/jdwp/VMFrame.java,
gnu/classpath/jdwp/VMIdManager.java,
gnu/classpath/jdwp/VMVirtualMachine.java,
java/lang/reflect/VMProxy.java: New files.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC
list.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/net/DefaultContentHandlerFactory.java (getContent):
Remove ClasspathToolkit references.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/awt/xlib/XCanvasPeer.java: Add new peer methods.
* gnu/awt/xlib/XFramePeer.java: Likewise.
* gnu/awt/xlib/XGraphicsConfiguration.java: Likewise.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add
classpath/native/jawt/jawt.c.
* Makefile.in: Regenerate.
* jawt.c: Remove file.
* include/Makefile.am (tool_include__HEADERS): Remove jawt.h and
jawt_md.h. Add ../classpath/include/jawt.h and
../classpath/include/jawt_md.h.
* include/Makefile.in: Regenerate.
* include/jawt.h: Regenerate.
* include/jawt_md.h: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/gnu/CORBA/gnuAny.java')
| -rw-r--r-- | libjava/classpath/gnu/CORBA/gnuAny.java | 94 |
1 files changed, 74 insertions, 20 deletions
diff --git a/libjava/classpath/gnu/CORBA/gnuAny.java b/libjava/classpath/gnu/CORBA/gnuAny.java index a48c50d61ba..7e5ef335149 100644 --- a/libjava/classpath/gnu/CORBA/gnuAny.java +++ b/libjava/classpath/gnu/CORBA/gnuAny.java @@ -38,6 +38,7 @@ exception statement from your version. */ package gnu.CORBA; +import gnu.CORBA.CDR.Vio; import gnu.CORBA.CDR.cdrBufInput; import gnu.CORBA.CDR.cdrBufOutput; @@ -63,6 +64,7 @@ import org.omg.CORBA.TypeCode; import org.omg.CORBA.TypeCodeHolder; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.ValueBaseHolder; +import org.omg.CORBA.portable.BoxedValueHelper; import org.omg.CORBA.portable.Streamable; import java.io.IOException; @@ -499,20 +501,33 @@ public class gnuAny } /** {@inheritDoc} */ - public void insert_Value(Serializable x, TypeCode typecode) + public void insert_Value(Serializable x, TypeCode c_typecode) { - type(typecode); - insert_Value(x); + if (typecode != null && typecode.kind() == TCKind.tk_value_box) + { + has = new gnuValueHolder(x, typecode); + } + else + { + type(typecode); + insert_Value(x); + } } /** {@inheritDoc} */ public void insert_Value(Serializable x) { - resetTypes(); - if (has instanceof ValueBaseHolder) - ((ValueBaseHolder) has).value = x; + if (typecode != null && typecode.kind() == TCKind.tk_value_box) + { + has = new gnuValueHolder(x, typecode); + } else - has = new ValueBaseHolder(x); + { + if (has instanceof ValueBaseHolder) + ((ValueBaseHolder) has).value = x; + else + has = new ValueBaseHolder(x); + } } /** @@ -748,15 +763,38 @@ public class gnuAny } } type(a_type); - has._read(input); - } - catch (BadKind ex) - { - throw new MARSHAL("Bad kind: " + ex.getMessage()); + + if (!(has instanceof universalHolder) && + (kind == TCKind._tk_value_box)) + { + // The streamable only contains operations for + // reading the value, not the value header. + Field vField = has.getClass().getField("value"); + + BoxedValueHelper helper; + + try + { + Class helperClass = + Class.forName(ObjectCreator.toHelperName(a_type.id())); + helper = (BoxedValueHelper) helperClass.newInstance(); + } + catch (Exception ex) + { + helper = null; + } + + Object content = Vio.read(input, helper); + vField.set(has, content); + } + else + has._read(input); } - catch (IOException ex) + catch (Exception ex) { - throw new MARSHAL("IO exception: " + ex.getMessage()); + MARSHAL m = new MARSHAL(); + m.initCause(ex); + throw m; } } @@ -790,6 +828,12 @@ public class gnuAny { if (has != null) has._write(output); + else + // These kinds support null. + if (xKind == TCKind._tk_null || xKind == TCKind._tk_objref || + xKind == TCKind._tk_value || xKind == TCKind._tk_value_box + ) + output.write_long(0); } /** @@ -806,16 +850,26 @@ public class gnuAny if (xKind >= 0) { if (xKind != kind) - throw new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + - " when stored " + typeNamer.nameIt(xKind) - ); + if (!( + xKind == TCKind._tk_alias && + has._type().kind().value() == kind + ) + ) + throw new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + + " when stored " + typeNamer.nameIt(xKind) + ); } else { if (type().kind().value() != kind) - throw new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + - " stored " + typeNamer.nameIt(type()) - ); + if (!( + type().kind().value() == TCKind._tk_alias && + has._type().kind().value() == kind + ) + ) + throw new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + + " stored " + typeNamer.nameIt(type()) + ); } } |

