After some lengthy experimentation with test programs (which is
something I love to do, honestly) (even if the slow iteration cycle on
Android is a bit irrtating), the root cause to my problem seems pretty
obvious. The concept of field ID in "normal" JVMs and in Android's
Dalvik appears to be quite different.
In normal JVMs, a field id is a small integer, in no way unique. If
two classes both have a field with a certain name and no other
fields, the id of that field is the same for both classes. The field
id of Context in com.sun.star.uno.Exception and in
com.sun.star.uno.RuntimeException are the same.
In Dalvik, field ids are basically pointers to some internal
structure. And they indeed seem to be unique for each field in each
class.
So it is quite obvious that what the code apparently tries to do doesn't work.
In the IDL and C++, css::uno::Exception has a Context field.
css::uno::RuntimeException is a subclass of css::uno::Exception with
no fields of its own, it inherits Exception's Context field.
But the corresponding Java UNO types, in ridl.jar, have a different
relationship.
com.sun.star.uno.RuntimeException extends java.lang.RuntimeException
and has a Context field, and com.sun.star.uno.Exception extends
java.lang.Exception and has its own Context field.
Hmm. OK, I think I get it, Java's RuntimeException (and the subclasses
of that) has significantly different semantics than that of its
Exception (and subclasses), unchecked vs. checked. The intent is that
the UNO exceptions be similarly divided when viewed on the Java side.
Presumably that can not be changed.
--tml
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.