[Libreoffice-commits] .: codemaker/test cppuhelper/source javaunohelper/com udkapi/com

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 17 10:14:40 PDT 2012


 codemaker/test/javamaker/java15/Test.java                    |    7 ++++---
 cppuhelper/source/component_context.cxx                      |    3 ++-
 javaunohelper/com/sun/star/comp/helper/ComponentContext.java |    3 ++-
 udkapi/com/sun/star/uno/XComponentContext.idl                |    4 ++--
 4 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit d2092dc56b19c24b481f64fa9708f4ed3f9c8dfb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 17 19:12:34 2012 +0200

    Keep null service manager throw a DeploymentException
    
    ...rather than a general RuntimeException, for consistency with existing service
    ctor code.
    
    Change-Id: Ia9ac14a1b5bcecb24394e7b9cade369f3f9303f0

diff --git a/codemaker/test/javamaker/java15/Test.java b/codemaker/test/javamaker/java15/Test.java
index 40401cf..30ffb41 100644
--- a/codemaker/test/javamaker/java15/Test.java
+++ b/codemaker/test/javamaker/java15/Test.java
@@ -19,6 +19,7 @@
 package test.codemaker.javamaker.java15;
 
 import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.uno.DeploymentException;
 import com.sun.star.uno.XComponentContext;
 import complexlib.ComplexTestCase;
 
@@ -68,18 +69,18 @@ public final class Test extends ComplexTestCase {
                 }
 
                 public XMultiComponentFactory getServiceManager() {
-                    throw new com.sun.star.uno.RuntimeException();
+                    throw new DeploymentException();
                 }
             };
         try {
             Service.create(context);
             failed();
-        } catch (com.sun.star.uno.RuntimeException e) {}
+        } catch (DeploymentException e) {}
         try {
             Service.create(
                 context, false, (byte) 1, (short) 2, Integer.valueOf(4));
             failed();
-        } catch (com.sun.star.uno.RuntimeException e) {}
+        } catch (DeploymentException e) {}
     }
 
     private static final class Ifc implements XIfc {
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index ac416f1..4ad3e13 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -60,6 +60,7 @@
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include "com/sun/star/uno/DeploymentException.hpp"
 #include "com/sun/star/uno/RuntimeException.hpp"
 
 #include <memory>
@@ -674,7 +675,7 @@ Reference< lang::XMultiComponentFactory > ComponentContext::getServiceManager()
 {
     if ( !m_xSMgr.is() )
     {
-        throw RuntimeException(
+        throw DeploymentException(
             "null component context service manager",
             static_cast<OWeakObject *>(this) );
     }
diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java
index 2294af8..c47d623 100644
--- a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java
+++ b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java
@@ -20,6 +20,7 @@ package com.sun.star.comp.helper;
 import com.sun.star.uno.UnoRuntime;
 import com.sun.star.uno.Any;
 
+import com.sun.star.uno.DeploymentException;
 import com.sun.star.uno.XComponentContext;
 import com.sun.star.lang.XMultiComponentFactory;
 import com.sun.star.lang.XSingleComponentFactory;
@@ -209,7 +210,7 @@ public class ComponentContext implements XComponentContext, XComponent
     {
         if (m_xSMgr == null)
         {
-            throw new com.sun.star.uno.RuntimeException(
+            throw new DeploymentException(
                 "null component context service manager" );
         }
         return m_xSMgr;
diff --git a/udkapi/com/sun/star/uno/XComponentContext.idl b/udkapi/com/sun/star/uno/XComponentContext.idl
index c45a1c1..3cc57ee 100644
--- a/udkapi/com/sun/star/uno/XComponentContext.idl
+++ b/udkapi/com/sun/star/uno/XComponentContext.idl
@@ -49,8 +49,8 @@ published interface XComponentContext : XInterface
         service manager is used very often.
 
         @return
-                service manager; throws RuntimeException in case service manager
-                is null
+                service manager; throws DeploymentException in case service
+                manager is null
     */
     com::sun::star::lang::XMultiComponentFactory getServiceManager();
 };


More information about the Libreoffice-commits mailing list