From 543158edba6678d3d76eee983a9d4edd2a422fee Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 17 Sep 2012 16:56:19 +0200 Subject: Require XComponentContext.getServiceManager to throw instead of returning null This is such a fatal error that there is probably no point in trying to handle it, so allow to simplify client code by removing the requirement to check for a null return value. Simplified some client code accordingly (modules configmgr and ure, and the code generated by cppumaker and javamaker). Change-Id: I51c0b270ec73409374f7439a47ee061407a46e31 --- javaunohelper/com/sun/star/comp/helper/ComponentContext.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'javaunohelper') diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java index 5075eb8d224d..2294af8a12bd 100644 --- a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java +++ b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java @@ -207,6 +207,11 @@ public class ComponentContext implements XComponentContext, XComponent //______________________________________________________________________________________________ public XMultiComponentFactory getServiceManager() { + if (m_xSMgr == null) + { + throw new com.sun.star.uno.RuntimeException( + "null component context service manager" ); + } return m_xSMgr; } -- cgit