summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-10 13:34:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-10 16:04:35 +0100
commit48a52621647aa72d15c0c9fb430faf9cbac01e6f (patch)
tree36c6ed4df374944bee4857aabae4026433a3923d
parent63a2168a6ea783d2c3824cdde8983dbfad147417 (diff)
Fix generation of com.sun.star.uno.[Runtime]Exception classes
Change-Id: If9bd4d906906e0e6cd7c5bb61f8a67a163218395 (cherry picked from commit 662e3299c578e2bff8a1cb9884e6266353ea1ebe)
-rw-r--r--codemaker/source/javamaker/javatype.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 4dc7f5c5647a..f60b1635c5cb 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -1825,18 +1825,22 @@ void handleExceptionType(
MethodDescriptor desc2(manager, dependencies, "void", 0, 0);
code.reset(cf->newCode());
code->loadLocalReference(0);
- sal_uInt16 index3 = 1;
- code->loadLocalReference(index3++);
- code->loadLocalReference(index3++);
+ sal_uInt16 index3 = 3;
// Note that we hack in the java.lang.Throwable parameter further down,
// because MethodDescriptor does not know how to handle it.
desc2.addParameter("string", false, true, 0);
- if (!(baseException || baseRuntimeException)) {
+ if (baseException || baseRuntimeException) {
+ code->loadLocalReference(2);
+ code->loadLocalReference(1);
+ code->instrInvokespecial(superClass, "<init>", "(Ljava/lang/String;Ljava/lang/Throwable;)V");
+ } else {
+ code->loadLocalReference(1);
+ code->loadLocalReference(2);
addExceptionBaseArguments(
manager, dependencies, &desc2, code.get(), entity->getDirectBase(),
&index3);
+ code->instrInvokespecial(superClass, "<init>", "(Ljava/lang/Throwable;" + desc2.getDescriptor().copy(1));
}
- code->instrInvokespecial(superClass, "<init>", "(Ljava/lang/Throwable;" + desc2.getDescriptor().copy(1));
sal_uInt16 maxSize2 = index3;
if (baseRuntimeException) {
maxSize2 = std::max(