codemaker/source/javamaker/javatype.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 48a52621647aa72d15c0c9fb430faf9cbac01e6f
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Wed Dec 10 13:34:04 2014 +0100

    Fix generation of com.sun.star.uno.[Runtime]Exception classes
    
    Change-Id: If9bd4d906906e0e6cd7c5bb61f8a67a163218395
    (cherry picked from commit 662e3299c578e2bff8a1cb9884e6266353ea1ebe)

diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 4dc7f5c..f60b163 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(
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to