summaryrefslogtreecommitdiff
path: root/codemaker/source
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 13:34:04 +0100
commit662e3299c578e2bff8a1cb9884e6266353ea1ebe (patch)
treed5a382c79790be72af1fbcd48238da0eed42e3fd /codemaker/source
parentd1577ee1ed215d9d4adfcdc0a71e2cfec0f3ebda (diff)
Fix generation of com.sun.star.uno.[Runtime]Exception classes
Change-Id: If9bd4d906906e0e6cd7c5bb61f8a67a163218395
Diffstat (limited to 'codemaker/source')
-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(