diff options
author | Noel Grandin <noel@peralex.com> | 2013-04-17 14:59:35 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-04-19 07:52:08 +0000 |
commit | 8d87758d65e4a03271f76e354dfc84c1fcd5fe21 (patch) | |
tree | bc8f4f0df6981ad10fe1333db1a2b015ea079709 /scripting | |
parent | d62425cc27e04a3237cfec2ea2663b8b11284ec8 (diff) |
Java cleanup, remove the rest of the unnecessary casts
Change-Id: Ia61d250f6b3711abc29569c5ece38a6f87e38daa
Reviewed-on: https://gerrit.libreoffice.org/3432
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'scripting')
19 files changed, 62 insertions, 82 deletions
diff --git a/scripting/java/com/sun/star/script/framework/io/XInputStreamImpl.java b/scripting/java/com/sun/star/script/framework/io/XInputStreamImpl.java index d1c65bd5dfb8..d1c1c6d46c2b 100644 --- a/scripting/java/com/sun/star/script/framework/io/XInputStreamImpl.java +++ b/scripting/java/com/sun/star/script/framework/io/XInputStreamImpl.java @@ -73,7 +73,7 @@ public class XInputStreamImpl implements XInputStream long bytesSkipped = 0; try { - bytesSkipped = is.skip( (long)nBytesToSkip ); + bytesSkipped = is.skip( nBytesToSkip ); } catch ( IOException e ) { diff --git a/scripting/java/org/openoffice/idesupport/ExtensionFinder.java b/scripting/java/org/openoffice/idesupport/ExtensionFinder.java index 1edfba296fbd..55ceeb13c247 100644 --- a/scripting/java/org/openoffice/idesupport/ExtensionFinder.java +++ b/scripting/java/org/openoffice/idesupport/ExtensionFinder.java @@ -50,7 +50,7 @@ public class ExtensionFinder implements MethodFinder { findFiles(files, basedir, parcelName); if (files.size() != 0) - return (ScriptEntry[])files.toArray(empty); + return files.toArray(empty); return empty; } diff --git a/scripting/java/org/openoffice/idesupport/localoffice/LocalOfficeImpl.java b/scripting/java/org/openoffice/idesupport/localoffice/LocalOfficeImpl.java index faba9d79df12..3a6d946b4c98 100644 --- a/scripting/java/org/openoffice/idesupport/localoffice/LocalOfficeImpl.java +++ b/scripting/java/org/openoffice/idesupport/localoffice/LocalOfficeImpl.java @@ -86,7 +86,7 @@ public final class LocalOfficeImpl Object object = null; object = mComponentContext.getValueByName(STORAGE_MRG_SINGLETON); XScriptStorageManager storageMgr; - storageMgr = (XScriptStorageManager)UnoRuntime.queryInterface( + storageMgr = UnoRuntime.queryInterface( XScriptStorageManager.class, object); storageMgr.refreshScriptStorage(uri); } catch (java.lang.Exception ex) { @@ -128,13 +128,13 @@ System.out.println("*** LocalOfficeImpl.refreshStorage: DONE"); "uno:socket,host=localhost,port=" + port + ";urp;StarOffice.ServiceManager"); - mComponentFactory = (XMultiComponentFactory)UnoRuntime.queryInterface( + mComponentFactory = UnoRuntime.queryInterface( XMultiComponentFactory.class, object); XPropertySet factoryProps; - factoryProps = (XPropertySet)UnoRuntime.queryInterface( + factoryProps = UnoRuntime.queryInterface( XPropertySet.class, mComponentFactory); object = factoryProps.getPropertyValue("DefaultContext"); - mComponentContext = (XComponentContext)UnoRuntime.queryInterface( + mComponentContext = UnoRuntime.queryInterface( XComponentContext.class, object); } } diff --git a/scripting/workben/ifc/scripting/ScriptingUtils.java b/scripting/workben/ifc/scripting/ScriptingUtils.java index 45ff3f96e10a..f10cf53f15b5 100644 --- a/scripting/workben/ifc/scripting/ScriptingUtils.java +++ b/scripting/workben/ifc/scripting/ScriptingUtils.java @@ -68,19 +68,17 @@ public class ScriptingUtils { if (storageManager == null) { try { - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, xMSF); - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, - xProp.getPropertyValue("DefaultContext")); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, + xProp.getPropertyValue("DefaultContext")); XInterface ifc = (XInterface) xContext.getValueByName("/singletons/drafts.com.sun.star." + "script.framework.storage.theScriptStorageManager"); - storageManager = (XScriptStorageManager) - UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); + storageManager = UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); } catch( Exception e ) { return -1; @@ -103,8 +101,7 @@ public class ScriptingUtils { Object fa = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - access = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); + access = UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); } catch (com.sun.star.uno.Exception e) { return null; diff --git a/scripting/workben/ifc/scripting/SecurityDialogUtil.java b/scripting/workben/ifc/scripting/SecurityDialogUtil.java index 0dec7c3339c0..bbd2ee33aa4d 100644 --- a/scripting/workben/ifc/scripting/SecurityDialogUtil.java +++ b/scripting/workben/ifc/scripting/SecurityDialogUtil.java @@ -95,10 +95,10 @@ public void run() XInterface x = (XInterface) xMSF.createInstance( "com.sun.star.awt.Toolkit") ; XExtendedToolkit tk = - (XExtendedToolkit)UnoRuntime.queryInterface( - XExtendedToolkit.class,x); + UnoRuntime.queryInterface( + XExtendedToolkit.class,x); AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow)UnoRuntime.queryInterface( + XWindow xWindow = UnoRuntime.queryInterface( XWindow.class,tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); xCon = xRoot.getAccessibleContext(); @@ -135,8 +135,8 @@ public void run() // want to do this action now // probably equates to toggle cb XAccessibleAction xAction = - (XAccessibleAction)UnoRuntime.queryInterface( - XAccessibleAction.class, xAcc.getAccessibleContext()); + UnoRuntime.queryInterface( + XAccessibleAction.class, xAcc.getAccessibleContext()); xAction.doAccessibleAction(0); // might be worth using oObj2 to double check the new state?? @@ -149,8 +149,8 @@ public void run() } // press button XAccessibleAction xAction = - (XAccessibleAction)UnoRuntime.queryInterface( - XAccessibleAction.class, oObj); + UnoRuntime.queryInterface( + XAccessibleAction.class, oObj); xAction.doAccessibleAction(0); } catch(com.sun.star.lang.IndexOutOfBoundsException e) { diff --git a/scripting/workben/ifc/scripting/_XScriptInfoAccess.java b/scripting/workben/ifc/scripting/_XScriptInfoAccess.java index f5ad117f0306..765936a72584 100644 --- a/scripting/workben/ifc/scripting/_XScriptInfoAccess.java +++ b/scripting/workben/ifc/scripting/_XScriptInfoAccess.java @@ -188,8 +188,7 @@ public class _XScriptInfoAccess extends MultiMethodTest { Object obj = ScriptingUtils.getDefault().getScriptStorage( (XMultiServiceFactory) tParam.getMSF(), location); - XScriptInfoAccess access = (XScriptInfoAccess) - UnoRuntime.queryInterface(XScriptInfoAccess.class, obj); + XScriptInfoAccess access = UnoRuntime.queryInterface(XScriptInfoAccess.class, obj); XScriptInfo[] impls = access.getAllImplementations(); diff --git a/scripting/workben/ifc/scripting/_XScriptInvocation.java b/scripting/workben/ifc/scripting/_XScriptInvocation.java index ec13d4d139db..a9b9b72c8255 100644 --- a/scripting/workben/ifc/scripting/_XScriptInvocation.java +++ b/scripting/workben/ifc/scripting/_XScriptInvocation.java @@ -151,19 +151,17 @@ public class _XScriptInvocation extends MultiMethodTest { if (storageManager == null) { try { - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, tParam.getMSF()); - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, - xProp.getPropertyValue("DefaultContext")); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, + xProp.getPropertyValue("DefaultContext")); XInterface ifc = (XInterface) xContext.getValueByName("/singletons/drafts.com.sun.star." + "script.framework.storage.theScriptStorageManager"); - storageManager = (XScriptStorageManager) - UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); + storageManager = UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); } catch( Exception e ) { return -1; @@ -186,8 +184,7 @@ public class _XScriptInvocation extends MultiMethodTest { Object fa = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.ucb.SimpleFileAccess"); - access = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); + access = UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); } catch (com.sun.star.uno.Exception e) { return null; @@ -203,7 +200,7 @@ public class _XScriptInvocation extends MultiMethodTest { try { Object obj = factory.loadDocument(fullname); - model = (XModel) UnoRuntime.queryInterface(XModel.class, obj); + model = UnoRuntime.queryInterface(XModel.class, obj); } catch (com.sun.star.lang.IllegalArgumentException iae) { return null; diff --git a/scripting/workben/ifc/scripting/_XScriptNameResolver.java b/scripting/workben/ifc/scripting/_XScriptNameResolver.java index 0a77a3f74608..95601ca95666 100644 --- a/scripting/workben/ifc/scripting/_XScriptNameResolver.java +++ b/scripting/workben/ifc/scripting/_XScriptNameResolver.java @@ -131,19 +131,17 @@ public class _XScriptNameResolver extends MultiMethodTest { if (storageManager == null) { try { - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, tParam.getMSF()); - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, - xProp.getPropertyValue("DefaultContext")); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, + xProp.getPropertyValue("DefaultContext")); XInterface ifc = (XInterface) xContext.getValueByName("/singletons/drafts.com.sun.star." + "script.framework.storage.theScriptStorageManager"); - storageManager = (XScriptStorageManager) - UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); + storageManager = UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); } catch( Exception e ) { return -1; @@ -166,8 +164,7 @@ public class _XScriptNameResolver extends MultiMethodTest { Object fa = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.ucb.SimpleFileAccess"); - access = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); + access = UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); } catch (com.sun.star.uno.Exception e) { return null; diff --git a/scripting/workben/ifc/scripting/_XScriptSecurity.java b/scripting/workben/ifc/scripting/_XScriptSecurity.java index 69bb8f1ddf9a..de4ca0b693cf 100644 --- a/scripting/workben/ifc/scripting/_XScriptSecurity.java +++ b/scripting/workben/ifc/scripting/_XScriptSecurity.java @@ -203,8 +203,7 @@ public class _XScriptSecurity extends MultiMethodTest { Object oProv = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.configuration.ConfigurationProvider" ); - XMultiServiceFactory xProv = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, oProv); + XMultiServiceFactory xProv = UnoRuntime.queryInterface(XMultiServiceFactory.class, oProv); //the path to the security settings in the registry PropertyValue aPathArg = new PropertyValue(); @@ -221,7 +220,7 @@ public class _XScriptSecurity extends MultiMethodTest { Object oConfigUpdate = xProv.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgs ); - XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, oConfigUpdate ); String[] paths = (String[])xPropertySet.getPropertyValue("SecureURL"); @@ -245,8 +244,7 @@ public class _XScriptSecurity extends MultiMethodTest { Object oProv = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.configuration.ConfigurationProvider" ); - XMultiServiceFactory xProv = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, oProv); + XMultiServiceFactory xProv = UnoRuntime.queryInterface(XMultiServiceFactory.class, oProv); //the path to the security settings in the registry PropertyValue aPathArg = new PropertyValue(); @@ -263,9 +261,9 @@ public class _XScriptSecurity extends MultiMethodTest { Object oConfigUpdate = xProv.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArgs ); - XNameReplace xNameReplace = (XNameReplace)UnoRuntime.queryInterface( + XNameReplace xNameReplace = UnoRuntime.queryInterface( XNameReplace.class, oConfigUpdate ); - XChangesBatch xChangesBatch = (XChangesBatch)UnoRuntime.queryInterface( + XChangesBatch xChangesBatch = UnoRuntime.queryInterface( XChangesBatch.class, oConfigUpdate ); Object[] aSecureURLs; @@ -323,19 +321,17 @@ public class _XScriptSecurity extends MultiMethodTest { if (storageManager == null) { try { - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, tParam.getMSF()); - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, - xProp.getPropertyValue("DefaultContext")); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, + xProp.getPropertyValue("DefaultContext")); XInterface ifc = (XInterface) xContext.getValueByName("/singletons/drafts.com.sun.star." + "script.framework.storage.theScriptStorageManager"); - storageManager = (XScriptStorageManager) - UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); + storageManager = UnoRuntime.queryInterface(XScriptStorageManager.class, ifc); } catch( Exception e ) { return -1; @@ -358,8 +354,7 @@ public class _XScriptSecurity extends MultiMethodTest { Object fa = ((XMultiServiceFactory)tParam.getMSF()).createInstance( "com.sun.star.ucb.SimpleFileAccess"); - access = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); + access = UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); } catch (com.sun.star.uno.Exception e) { return null; @@ -375,7 +370,7 @@ public class _XScriptSecurity extends MultiMethodTest { try { Object obj = factory.loadDocument(fullname); - model = (XModel) UnoRuntime.queryInterface(XModel.class, obj); + model = UnoRuntime.queryInterface(XModel.class, obj); } catch (com.sun.star.lang.IllegalArgumentException iae) { return null; diff --git a/scripting/workben/ifc/scripting/_XScriptStorageManager.java b/scripting/workben/ifc/scripting/_XScriptStorageManager.java index 81c82fabed70..ea2b483010bd 100644 --- a/scripting/workben/ifc/scripting/_XScriptStorageManager.java +++ b/scripting/workben/ifc/scripting/_XScriptStorageManager.java @@ -244,8 +244,7 @@ public class _XScriptStorageManager extends MultiMethodTest { Object fa = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.ucb.SimpleFileAccess"); - access = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); + access = UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); } catch (com.sun.star.uno.Exception e) { return null; diff --git a/scripting/workben/installer/IdeVersion.java b/scripting/workben/installer/IdeVersion.java index bf626a3aecba..229eeed44f97 100644 --- a/scripting/workben/installer/IdeVersion.java +++ b/scripting/workben/installer/IdeVersion.java @@ -178,7 +178,7 @@ public class IdeVersion extends javax.swing.JPanel implements ActionListener, Ta wizard.clearLocations(); int len = tableModel.data.size(); for (int i = 0; i < len; i++) { - ArrayList<?> list = (ArrayList<?>)tableModel.data.get(i); + ArrayList<?> list = tableModel.data.get(i); if (((Boolean)list.get(0)).booleanValue() == true) wizard.storeLocation((String)list.get(2)); } @@ -315,7 +315,7 @@ class MyTableModelIDE extends AbstractTableModel { col < 0 || col > getColumnCount()) return null; - ArrayList<?> aRow = (ArrayList<?>)data.get(row); + ArrayList<?> aRow = data.get(row); return aRow.get(col); } @@ -332,7 +332,7 @@ class MyTableModelIDE extends AbstractTableModel { } public void setValueAt(Object value, int row, int col) { - ArrayList<Object> aRow = (ArrayList<Object>)data.get(row); + ArrayList<Object> aRow = data.get(row); aRow.set(col, value); fireTableCellUpdated(row, col); } diff --git a/scripting/workben/installer/Version.java b/scripting/workben/installer/Version.java index e2527823b9b7..17ec8e7c3230 100644 --- a/scripting/workben/installer/Version.java +++ b/scripting/workben/installer/Version.java @@ -211,7 +211,7 @@ public class Version extends javax.swing.JPanel implements ActionListener, Table wizard.clearLocations(); int len = tableModel.data.size(); for (int i = 0; i < len; i++) { - ArrayList<?> list = (ArrayList<?>)tableModel.data.get(i); + ArrayList<?> list = tableModel.data.get(i); if (((Boolean)list.get(0)).booleanValue() == true) wizard.storeLocation((String)list.get(2)); } @@ -306,7 +306,7 @@ class MyTableModel extends AbstractTableModel { col < 0 || col > getColumnCount()) return null; - ArrayList<?> aRow = (ArrayList<?>)data.get(row); + ArrayList<?> aRow = data.get(row); return aRow.get(col); } diff --git a/scripting/workben/installer/Welcome.java b/scripting/workben/installer/Welcome.java index 8dc578515e10..9a5cf4790acd 100644 --- a/scripting/workben/installer/Welcome.java +++ b/scripting/workben/installer/Welcome.java @@ -115,7 +115,7 @@ public class Welcome extends javax.swing.JPanel implements ActionListener { for( int i = 0; i < versions.length; i++ ) { String key = versions[i]; - String progPath = ( String )props.getProperty( key ); + String progPath = props.getProperty( key ); if ( progPath != null ){ progPath = progPath + File.separator + "program"; diff --git a/scripting/workben/mod/_scripting/Dispatch.java b/scripting/workben/mod/_scripting/Dispatch.java index f3b7cf50b317..f23a64fccdba 100644 --- a/scripting/workben/mod/_scripting/Dispatch.java +++ b/scripting/workben/mod/_scripting/Dispatch.java @@ -58,15 +58,14 @@ public class Dispatch extends TestCase { SOF = SOfficeFactory.getFactory( xMSF ); String docPath = util.utils.getFullTestURL( "ExampleSpreadSheetLatest.sxc" ); XComponent doc = SOF.loadDocument( docPath ); - XModel model = ( XModel ) UnoRuntime.queryInterface( XModel.class, + XModel model = UnoRuntime.queryInterface( XModel.class, doc ); XFrame frame = model.getCurrentController().getFrame(); oObj = ( XInterface )xMSF.createInstanceWithArguments( "com.sun.star.comp.ScriptProtocolHandler", new Object[] { frame } ); - XURLTransformer xParser=(XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)tParam.getMSF()).createInstance - ("com.sun.star.util.URLTransformer")); + XURLTransformer xParser=UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)tParam.getMSF()).createInstance + ("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of // URL objects. URL[] aParseURL = new URL[1]; diff --git a/scripting/workben/mod/_scripting/Function.java b/scripting/workben/mod/_scripting/Function.java index 350e2d9ba7ad..ef697a916825 100644 --- a/scripting/workben/mod/_scripting/Function.java +++ b/scripting/workben/mod/_scripting/Function.java @@ -53,11 +53,11 @@ public class Function extends TestCase { SOF = SOfficeFactory.getFactory( xMSF ); String docPath = util.utils.getFullTestURL(doc); XComponent doc = SOF.loadDocument( docPath ); - XModel model = ( XModel ) UnoRuntime.queryInterface( XModel.class, + XModel model = UnoRuntime.queryInterface( XModel.class, doc ); oObj = (XInterface)xMSF.createInstanceWithArguments( "drafts.com.sun.star.script.framework.provider.FunctionProvider", new Object[]{ model } ); - provider = ( XFunctionProvider )UnoRuntime.queryInterface( XFunctionProvider.class, oObj ); + provider = UnoRuntime.queryInterface( XFunctionProvider.class, oObj ); oObj = provider.getFunction( script ); } catch (com.sun.star.uno.Exception e) { diff --git a/scripting/workben/mod/_scripting/FunctionProvider.java b/scripting/workben/mod/_scripting/FunctionProvider.java index d053fd15c923..4c5cd0bcfff5 100644 --- a/scripting/workben/mod/_scripting/FunctionProvider.java +++ b/scripting/workben/mod/_scripting/FunctionProvider.java @@ -45,7 +45,7 @@ public class FunctionProvider extends TestCase { XMultiServiceFactory xMSF = (XMultiServiceFactory) tParam.getMSF(); Object xInterface = xMSF.createInstance( "com.sun.star.frame.Desktop" ); - XDesktop dtop = ( XDesktop )UnoRuntime.queryInterface( XDesktop.class, + XDesktop dtop = UnoRuntime.queryInterface( XDesktop.class, xInterface ); XModel model = dtop.getCurrentFrame().getController().getModel(); diff --git a/scripting/workben/mod/_scripting/ScriptInfo.java b/scripting/workben/mod/_scripting/ScriptInfo.java index e0f313b7eb9c..f822fd5cb329 100644 --- a/scripting/workben/mod/_scripting/ScriptInfo.java +++ b/scripting/workben/mod/_scripting/ScriptInfo.java @@ -72,12 +72,11 @@ public class ScriptInfo extends TestCase { XMultiServiceFactory xMSF = (XMultiServiceFactory) tParam.getMSF(); Object xInterface = xMSF.createInstance( "com.sun.star.ucb.SimpleFileAccess" ); - access = ( XSimpleFileAccess ) - UnoRuntime.queryInterface( XSimpleFileAccess.class, xInterface ); - Object storageObj = ( XInterface )xMSF.createInstanceWithArguments( + access = UnoRuntime.queryInterface( XSimpleFileAccess.class, xInterface ); + Object storageObj = xMSF.createInstanceWithArguments( "drafts.com.sun.star.script.framework.storage.ScriptStorage", new Object[]{ access, new Integer(99), docPath } ); - XScriptInfoAccess infoAccess = ( XScriptInfoAccess )UnoRuntime.queryInterface(XScriptInfoAccess.class, storageObj); + XScriptInfoAccess infoAccess = UnoRuntime.queryInterface(XScriptInfoAccess.class, storageObj); XScriptInfo[] infos = infoAccess.getImplementations("script://MemoryUtils.MemUsage?location=document"); oObj = infos[0]; } catch (com.sun.star.uno.Exception e) { diff --git a/scripting/workben/mod/_scripting/ScriptStorage.java b/scripting/workben/mod/_scripting/ScriptStorage.java index 5cc5e5b18a4e..3cdff81f4562 100644 --- a/scripting/workben/mod/_scripting/ScriptStorage.java +++ b/scripting/workben/mod/_scripting/ScriptStorage.java @@ -69,8 +69,7 @@ public class ScriptStorage extends TestCase { XMultiServiceFactory xMSF = (XMultiServiceFactory) tParam.getMSF(); Object xInterface = xMSF.createInstance( "com.sun.star.ucb.SimpleFileAccess" ); - access = ( XSimpleFileAccess ) - UnoRuntime.queryInterface( XSimpleFileAccess.class, xInterface ); + access = UnoRuntime.queryInterface( XSimpleFileAccess.class, xInterface ); oObj = ( XInterface )xMSF.createInstanceWithArguments( "drafts.com.sun.star.script.framework.storage.ScriptStorage", new Object[]{ access, new Integer(99), docPath } ); diff --git a/scripting/workben/mod/_scripting/ScriptStorageManager.java b/scripting/workben/mod/_scripting/ScriptStorageManager.java index 99152da4b3a2..aa7843a758e0 100644 --- a/scripting/workben/mod/_scripting/ScriptStorageManager.java +++ b/scripting/workben/mod/_scripting/ScriptStorageManager.java @@ -42,12 +42,11 @@ public class ScriptStorageManager extends TestCase { try { XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF(); - XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProp = UnoRuntime.queryInterface( XPropertySet.class, xMSF); // get context - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, - xProp.getPropertyValue("DefaultContext")); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, + xProp.getPropertyValue("DefaultContext")); // get the script storage manager from context oInterface = xContext.getValueByName("/singletons/" + "drafts.com.sun.star.script.framework.storage.theScriptStorageManager"); |