From c7788533a2565593405e55b617d09425e08ef439 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Wed, 16 Sep 2009 14:37:52 +0000 Subject: CWS-TOOLING: integrate CWS sb113 2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012 2009-08-28 sb #i102469# change back to just on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;) 2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012 2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph) 2009-08-26 sb merged in DEV300_m56 2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc) 2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora) 2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader 2009-08-17 Juergen Schmidt #i103749# integrate patch 2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8") 2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter 2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec 2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc) 2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc) 2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2) 2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly 2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH) 2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued") --- .../com/sun/star/comp/bridgefactory/BridgeFactory.java | 8 ++++---- jurt/com/sun/star/comp/loader/FactoryHelper.java | 4 ++-- jurt/com/sun/star/comp/loader/JavaLoader.java | 2 +- .../sun/star/comp/servicemanager/ServiceManager.java | 18 +++++++++--------- jurt/com/sun/star/comp/urlresolver/UrlResolver.java | 4 ++-- jurt/com/sun/star/uno/WeakReference.java | 4 ++-- jurt/demo/com/sun/star/demo/DemoServer.java | 4 ++-- jurt/demo/com/sun/star/demo/TestOffice.java | 18 +++++++++--------- .../star/comp/bridgefactory/BridgeFactory_Test.java | 4 ++-- .../bridges/java_remote/java_remote_bridge_Test.java | 6 +++--- .../sun/star/comp/urlresolver/UrlResolver_Test.java | 6 +++--- 11 files changed, 39 insertions(+), 39 deletions(-) (limited to 'jurt') diff --git a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java index 819ef024acfa..6dd90b3dd590 100644 --- a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java +++ b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java @@ -134,7 +134,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { if (hasName) { IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { - XBridge xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]); + XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) { if(xBridge.getName().equals(sName)) @@ -148,7 +148,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { try { IBridge iBridge = UnoRuntime.getBridgeByName("java", context, "remote", context, hasName ? new Object[]{sProtocol, aConnection, anInstanceProvider, sName} : new Object[]{sProtocol, aConnection, anInstanceProvider}); - xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridge); + xBridge = UnoRuntime.queryInterface(XBridge.class, iBridge); } catch(Exception exception) { throw new com.sun.star.lang.IllegalArgumentException(exception.getMessage()); @@ -171,7 +171,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { - xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]); + xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) { if(xBridge.getName().equals(sName)) @@ -199,7 +199,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { - XBridge xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]); + XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) vector.addElement(xBridge); diff --git a/jurt/com/sun/star/comp/loader/FactoryHelper.java b/jurt/com/sun/star/comp/loader/FactoryHelper.java index 451e387eb7d6..83c1c567509f 100644 --- a/jurt/com/sun/star/comp/loader/FactoryHelper.java +++ b/jurt/com/sun/star/comp/loader/FactoryHelper.java @@ -174,7 +174,7 @@ public class FactoryHelper { { if (xContext != null) { - return (XMultiServiceFactory)UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XMultiServiceFactory.class, xContext.getServiceManager() ); } else @@ -302,7 +302,7 @@ public class FactoryHelper { Object instance = _constructor.newInstance( args ); if (bInitCall) { - XInitialization xInitialization = (XInitialization)UnoRuntime.queryInterface( + XInitialization xInitialization = UnoRuntime.queryInterface( XInitialization.class, instance ); if (xInitialization != null) { diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java index 3565be7031a3..cf0d9995d7f6 100644 --- a/jurt/com/sun/star/comp/loader/JavaLoader.java +++ b/jurt/com/sun/star/comp/loader/JavaLoader.java @@ -102,7 +102,7 @@ public class JavaLoader implements XImplementationLoader, { if (m_xMacroExpander == null) { - XPropertySet xProps = (XPropertySet) + XPropertySet xProps = UnoRuntime.queryInterface( XPropertySet.class, multiServiceFactory ); if (xProps == null) diff --git a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java index adb0c54c7e28..b791c6501a36 100644 --- a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java +++ b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java @@ -158,7 +158,7 @@ public class ServiceManager implements XMultiServiceFactory, if (loaderObj == null) throw new com.sun.star.uno.Exception("Can get an instance of com.sun.star.loader.Java"); - return (XImplementationLoader) UnoRuntime.queryInterface( XImplementationLoader.class, loaderObj ); + return UnoRuntime.queryInterface( XImplementationLoader.class, loaderObj ); } /** @@ -380,7 +380,7 @@ public class ServiceManager implements XMultiServiceFactory, Object fac = queryServiceFactory( rServiceSpecifier ); if (fac != null) { - XSingleComponentFactory xCompFac = (XSingleComponentFactory)UnoRuntime.queryInterface( + XSingleComponentFactory xCompFac = UnoRuntime.queryInterface( XSingleComponentFactory.class, fac ); if (xCompFac != null) { @@ -388,7 +388,7 @@ public class ServiceManager implements XMultiServiceFactory, } else { - XSingleServiceFactory xServiceFac = (XSingleServiceFactory)UnoRuntime.queryInterface( + XSingleServiceFactory xServiceFac = UnoRuntime.queryInterface( XSingleServiceFactory.class, fac ); if (xServiceFac != null) { @@ -422,7 +422,7 @@ public class ServiceManager implements XMultiServiceFactory, Object fac = queryServiceFactory( rServiceSpecifier ); if (fac != null) { - XSingleComponentFactory xCompFac = (XSingleComponentFactory)UnoRuntime.queryInterface( + XSingleComponentFactory xCompFac = UnoRuntime.queryInterface( XSingleComponentFactory.class, fac ); if (xCompFac != null) { @@ -430,7 +430,7 @@ public class ServiceManager implements XMultiServiceFactory, } else { - XSingleServiceFactory xServiceFac = (XSingleServiceFactory)UnoRuntime.queryInterface( + XSingleServiceFactory xServiceFac = UnoRuntime.queryInterface( XSingleServiceFactory.class, fac ); if (xServiceFac != null) { @@ -528,7 +528,7 @@ public class ServiceManager implements XMultiServiceFactory, if (object == null) throw new com.sun.star.uno.RuntimeException("The parameter must not been null"); - XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object); + XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, object); if (xServiceInfo != null) { return UnoRuntime.areSame(factoriesByImplNames.get(xServiceInfo.getImplementationName()), object); @@ -552,7 +552,7 @@ public class ServiceManager implements XMultiServiceFactory, if (object == null) throw new com.sun.star.lang.IllegalArgumentException(); XServiceInfo xServiceInfo = - (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object); + UnoRuntime.queryInterface(XServiceInfo.class, object); if (xServiceInfo == null) throw new com.sun.star.lang.IllegalArgumentException( @@ -606,7 +606,7 @@ public class ServiceManager implements XMultiServiceFactory, ); XServiceInfo xServiceInfo = - (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object); + UnoRuntime.queryInterface(XServiceInfo.class, object); if (xServiceInfo == null) throw new com.sun.star.lang.IllegalArgumentException( @@ -614,7 +614,7 @@ public class ServiceManager implements XMultiServiceFactory, ); XSingleServiceFactory xSingleServiceFactory = - (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, object); + UnoRuntime.queryInterface(XSingleServiceFactory.class, object); if (xSingleServiceFactory == null) throw new com.sun.star.lang.IllegalArgumentException( diff --git a/jurt/com/sun/star/comp/urlresolver/UrlResolver.java b/jurt/com/sun/star/comp/urlresolver/UrlResolver.java index cabd51d42404..6c63ccbd8490 100644 --- a/jurt/com/sun/star/comp/urlresolver/UrlResolver.java +++ b/jurt/com/sun/star/comp/urlresolver/UrlResolver.java @@ -102,7 +102,7 @@ public class UrlResolver { Object rootObject = null; XBridgeFactory xBridgeFactory= null; try { - xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(XBridgeFactory.class, + xBridgeFactory = UnoRuntime.queryInterface(XBridgeFactory.class, _xMultiServiceFactory.createInstance("com.sun.star.bridge.BridgeFactory")); } catch (com.sun.star.uno.Exception e) { throw new com.sun.star.uno.RuntimeException(e.getMessage()); @@ -117,7 +117,7 @@ public class UrlResolver { throw new com.sun.star.uno.RuntimeException(e.getMessage()); } - XConnector connector_xConnector = (XConnector)UnoRuntime.queryInterface(XConnector.class, connector); + XConnector connector_xConnector = UnoRuntime.queryInterface(XConnector.class, connector); // connect to the server XConnection xConnection = connector_xConnector.connect(conDcp); diff --git a/jurt/com/sun/star/uno/WeakReference.java b/jurt/com/sun/star/uno/WeakReference.java index 3c954efe1cf9..fc3b6f8100ba 100644 --- a/jurt/com/sun/star/uno/WeakReference.java +++ b/jurt/com/sun/star/uno/WeakReference.java @@ -61,7 +61,7 @@ public class WeakReference Object weakImpl= obj.get(); if (weakImpl != null) { - XWeak weak= (XWeak) UnoRuntime.queryInterface(XWeak.class, weakImpl); + XWeak weak= UnoRuntime.queryInterface(XWeak.class, weakImpl); if (weak != null) { XAdapter adapter= (XAdapter) weak.queryAdapter(); @@ -77,7 +77,7 @@ public class WeakReference */ public WeakReference(Object obj) { - XWeak weak= (XWeak) UnoRuntime.queryInterface(XWeak.class, obj); + XWeak weak= UnoRuntime.queryInterface(XWeak.class, obj); if (weak != null) { XAdapter adapter= (XAdapter) weak.queryAdapter(); diff --git a/jurt/demo/com/sun/star/demo/DemoServer.java b/jurt/demo/com/sun/star/demo/DemoServer.java index 8715215dcc70..5b0b8201f274 100644 --- a/jurt/demo/com/sun/star/demo/DemoServer.java +++ b/jurt/demo/com/sun/star/demo/DemoServer.java @@ -92,12 +92,12 @@ public class DemoServer { ServiceManager serviceManager = new ServiceManager(); serviceManager.addFactories(neededServices); - XAcceptor xAcceptor = (XAcceptor)UnoRuntime.queryInterface(XAcceptor.class, serviceManager.createInstance("com.sun.star.connection.Acceptor")); + XAcceptor xAcceptor = UnoRuntime.queryInterface(XAcceptor.class, serviceManager.createInstance("com.sun.star.connection.Acceptor")); System.err.println("waiting for connect..."); XConnection xConnection = xAcceptor.accept(conDcp); - XBridgeFactory xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(XBridgeFactory.class, serviceManager.createInstance("com.sun.star.bridge.BridgeFactory")); + XBridgeFactory xBridgeFactory = UnoRuntime.queryInterface(XBridgeFactory.class, serviceManager.createInstance("com.sun.star.bridge.BridgeFactory")); XBridge xBridge = xBridgeFactory.createBridge(conDcp + ";" + protDcp, protDcp, xConnection, new InstanceProvider()); } diff --git a/jurt/demo/com/sun/star/demo/TestOffice.java b/jurt/demo/com/sun/star/demo/TestOffice.java index 811889898c48..7b86c8e2dd7e 100644 --- a/jurt/demo/com/sun/star/demo/TestOffice.java +++ b/jurt/demo/com/sun/star/demo/TestOffice.java @@ -76,7 +76,7 @@ public class TestOffice { { byte bytes[][] = new byte[1][]; - XInputStream rIn = (XInputStream)UnoRuntime.queryInterface(XInputStream.class, rOut); + XInputStream rIn = UnoRuntime.queryInterface(XInputStream.class, rOut); if(rIn.available() != 10) System.err.println("wrong bytes available\n"); @@ -90,11 +90,11 @@ public class TestOffice { static void testWriter(XComponent rCmp) throws IOException { - XTextDocument rTextDoc = (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, rCmp); + XTextDocument rTextDoc = UnoRuntime.queryInterface(XTextDocument.class, rCmp); - XText rText = (XText)UnoRuntime.queryInterface(XText.class, rTextDoc.getText()); - XTextCursor rCursor = (XTextCursor)UnoRuntime.queryInterface(XTextCursor.class, rText.createTextCursor()); - XTextRange rRange = (XTextRange)UnoRuntime.queryInterface(XTextRange.class, rCursor); + XText rText = UnoRuntime.queryInterface(XText.class, rTextDoc.getText()); + XTextCursor rCursor = UnoRuntime.queryInterface(XTextCursor.class, rText.createTextCursor()); + XTextRange rRange = UnoRuntime.queryInterface(XTextRange.class, rCursor); byte pcText[] = new byte[1024]; pcText[0] = 0; @@ -112,7 +112,7 @@ public class TestOffice { } static void testDocument(XMultiServiceFactory rSmgr) throws com.sun.star.uno.Exception, IOException { - XComponentLoader rLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, rSmgr.createInstance("com.sun.star.frame.Desktop")); + XComponentLoader rLoader = UnoRuntime.queryInterface(XComponentLoader.class, rSmgr.createInstance("com.sun.star.frame.Desktop")); String urls[] = new String[] { "private:factory/swriter", @@ -148,13 +148,13 @@ public class TestOffice { } static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException { - XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, r); + XNamingService rName = UnoRuntime.queryInterface(XNamingService.class, r); if(rName != null) { System.err.println("got the remote naming service !"); Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager"); - XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr); + XMultiServiceFactory rSmgr = UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr); if(rSmgr != null) { System.err.println("got the remote service manager !"); // testPipe(rSmgr); @@ -183,7 +183,7 @@ public class TestOffice { smgr.addFactories(neededServices); Object resolver = smgr.createInstance("com.sun.star.bridge.UnoUrlResolver" ); - XUnoUrlResolver resolver_xUnoUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(XUnoUrlResolver.class, resolver); + XUnoUrlResolver resolver_xUnoUrlResolver = UnoRuntime.queryInterface(XUnoUrlResolver.class, resolver); Object rInitialObject = resolver_xUnoUrlResolver.resolve(argv[0]); diff --git a/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java b/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java index 8c6722c9f69a..a5fdccf613f8 100644 --- a/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java +++ b/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java @@ -75,7 +75,7 @@ public final class BridgeFactory_Test extends ComplexTestCase { assure("", UnoRuntime.areSame(xBridge, xBridges[0])); // dispose the bridge - XComponent xComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class, xBridge); + XComponent xComponent = UnoRuntime.queryInterface(XComponent.class, xBridge); xComponent.dispose(); @@ -103,7 +103,7 @@ public final class BridgeFactory_Test extends ComplexTestCase { && UnoRuntime.areSame(xBridge_new, xBridges[0])); // dispose the new bridge - XComponent xComponent_new = (XComponent)UnoRuntime.queryInterface(XComponent.class, xBridge_new); + XComponent xComponent_new = UnoRuntime.queryInterface(XComponent.class, xBridge_new); xComponent_new.dispose(); } } diff --git a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java index 8e71d51a0c6f..ffef8f7664a0 100644 --- a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java +++ b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java @@ -132,17 +132,17 @@ public final class java_remote_bridge_Test extends ComplexTestCase { proxyBXInterface[i] = (XInterface) bridgeB.getInstance(name); // map object: - proxyBTestInterface[i] = (TestInterface) UnoRuntime.queryInterface( + proxyBTestInterface[i] = UnoRuntime.queryInterface( TestInterface.class, proxyBXInterface[i]); proxyBTestInterface[i].function(); // remap object once: - TestInterface remapped = (TestInterface) UnoRuntime.queryInterface( + TestInterface remapped = UnoRuntime.queryInterface( TestInterface.class, proxyBXInterface[i]); remapped.function(); // remap object twice: - remapped = (TestInterface) UnoRuntime.queryInterface( + remapped = UnoRuntime.queryInterface( TestInterface.class, proxyBXInterface[i]); remapped.function(); } diff --git a/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java b/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java index 5e3110d140fa..94686e7135fd 100644 --- a/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java +++ b/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java @@ -58,19 +58,19 @@ public class UrlResolver_Test Object initialObject = urlResolver.resolve( "uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" ); - XMultiComponentFactory xOfficeFactory= (XMultiComponentFactory) UnoRuntime.queryInterface( + XMultiComponentFactory xOfficeFactory= UnoRuntime.queryInterface( XMultiComponentFactory.class, initialObject ); // retrieve the component context (it's not yet exported from the office) // Query for the XPropertySet interface. - XPropertySet xProperySet = ( XPropertySet ) UnoRuntime.queryInterface( + XPropertySet xProperySet = UnoRuntime.queryInterface( XPropertySet.class, xOfficeFactory); // Get the default context from the office server. Object oDefaultContext = xProperySet.getPropertyValue( "DefaultContext" ); // Query for the interface XComponentContext. - XComponentContext xOfficeComponentContext = ( XComponentContext ) UnoRuntime.queryInterface( + XComponentContext xOfficeComponentContext = UnoRuntime.queryInterface( XComponentContext.class, oDefaultContext ); // now create the desktop service -- cgit