summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-17 13:54:28 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-19 07:51:41 +0000
commitd62425cc27e04a3237cfec2ea2663b8b11284ec8 (patch)
treebc96f74a3460377c4d368ba2d3cbd56b2e8baa89 /extensions
parenta79d43dcd7989ee927de1b8c69ebc2981cc7166e (diff)
Java cleanup, remove unnecessary casts
Change-Id: Id12089bc7df16631737e6acaee0973fb91dd953f Reviewed-on: https://gerrit.libreoffice.org/3431 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/qa/integration/extensions/ConsoleWait.java2
-rw-r--r--extensions/qa/integration/extensions/Frame.java12
-rw-r--r--extensions/qa/integration/extensions/MethodHandler.java4
-rw-r--r--extensions/qa/integration/extensions/ObjectInspector.java8
-rw-r--r--extensions/qa/integration/extensions/ServicesHandler.java6
-rw-r--r--extensions/test/pgp/TestPGP.java6
6 files changed, 19 insertions, 19 deletions
diff --git a/extensions/qa/integration/extensions/ConsoleWait.java b/extensions/qa/integration/extensions/ConsoleWait.java
index 5a46f3899ebf..454bd535c635 100644
--- a/extensions/qa/integration/extensions/ConsoleWait.java
+++ b/extensions/qa/integration/extensions/ConsoleWait.java
@@ -75,7 +75,7 @@ public class ConsoleWait implements com.sun.star.lang.XEventListener
public ConsoleWait( Object _disposable )
{
m_disposable = _disposable;
- XComponent component = (XComponent)UnoRuntime.queryInterface( XComponent.class, _disposable );
+ XComponent component = UnoRuntime.queryInterface( XComponent.class, _disposable );
if ( component != null )
component.addEventListener( this );
}
diff --git a/extensions/qa/integration/extensions/Frame.java b/extensions/qa/integration/extensions/Frame.java
index a3c7b3e0d74e..098ffea82798 100644
--- a/extensions/qa/integration/extensions/Frame.java
+++ b/extensions/qa/integration/extensions/Frame.java
@@ -45,12 +45,12 @@ public class Frame implements XFrame,
{
if ( _frameComponent != null )
{
- m_frame = (XFrame)UnoRuntime.queryInterface( XFrame.class, _frameComponent );
- m_dispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface( XDispatchProvider.class, _frameComponent );
- m_dispatchProviderInterception = (XDispatchProviderInterception)UnoRuntime.queryInterface( XDispatchProviderInterception.class, _frameComponent );
- m_framesSupplier = (XFramesSupplier)UnoRuntime.queryInterface( XFramesSupplier.class, _frameComponent );
- m_statusIndicatorFactory = (XStatusIndicatorFactory)UnoRuntime.queryInterface( XStatusIndicatorFactory.class, _frameComponent );
- m_closeable = (XCloseable)UnoRuntime.queryInterface( XCloseable.class, _frameComponent );
+ m_frame = UnoRuntime.queryInterface( XFrame.class, _frameComponent );
+ m_dispatchProvider = UnoRuntime.queryInterface( XDispatchProvider.class, _frameComponent );
+ m_dispatchProviderInterception = UnoRuntime.queryInterface( XDispatchProviderInterception.class, _frameComponent );
+ m_framesSupplier = UnoRuntime.queryInterface( XFramesSupplier.class, _frameComponent );
+ m_statusIndicatorFactory = UnoRuntime.queryInterface( XStatusIndicatorFactory.class, _frameComponent );
+ m_closeable = UnoRuntime.queryInterface( XCloseable.class, _frameComponent );
}
}
diff --git a/extensions/qa/integration/extensions/MethodHandler.java b/extensions/qa/integration/extensions/MethodHandler.java
index 93c9ec8fbc7a..8508dca8fbda 100644
--- a/extensions/qa/integration/extensions/MethodHandler.java
+++ b/extensions/qa/integration/extensions/MethodHandler.java
@@ -41,7 +41,7 @@ public class MethodHandler implements XPropertyHandler
try
{
- m_introspection = (XIntrospection)UnoRuntime.queryInterface( XIntrospection.class,
+ m_introspection = UnoRuntime.queryInterface( XIntrospection.class,
m_context.getServiceManager().createInstanceWithContext( "com.sun.star.beans.Introspection", m_context )
);
}
@@ -92,7 +92,7 @@ public class MethodHandler implements XPropertyHandler
descriptor.IndentLevel = 0;
try
{
- XPropertyControl control = (XPropertyControl)UnoRuntime.queryInterface(
+ XPropertyControl control = UnoRuntime.queryInterface(
XPropertyControl.class, _propertyControlFactory.createPropertyControl(
PropertyControlType.TextField, true ) );
diff --git a/extensions/qa/integration/extensions/ObjectInspector.java b/extensions/qa/integration/extensions/ObjectInspector.java
index d42ef161015e..44f370e45562 100644
--- a/extensions/qa/integration/extensions/ObjectInspector.java
+++ b/extensions/qa/integration/extensions/ObjectInspector.java
@@ -59,8 +59,8 @@ public class ObjectInspector extends complexlib.ComplexTestCase
public void before() throws com.sun.star.uno.Exception, java.lang.Exception
{
m_orb = (XMultiServiceFactory)param.getMSF();
- m_context = (XComponentContext)UnoRuntime.queryInterface( XComponentContext.class,
- ((XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_orb )).getPropertyValue( "DefaultContext" ) );
+ m_context = UnoRuntime.queryInterface( XComponentContext.class,
+ UnoRuntime.queryInterface( XPropertySet.class, m_orb ).getPropertyValue( "DefaultContext" ) );
m_desktop = new Frame( m_orb.createInstance( "com.sun.star.frame.Desktop" ) );
}
@@ -145,7 +145,7 @@ public class ObjectInspector extends complexlib.ComplexTestCase
/* ------------------------------------------------------------------ */
private com.sun.star.awt.XWindow createFloatingWindow() throws com.sun.star.uno.Exception
{
- com.sun.star.awt.XToolkit toolkit = (com.sun.star.awt.XToolkit)UnoRuntime.queryInterface(
+ com.sun.star.awt.XToolkit toolkit = UnoRuntime.queryInterface(
com.sun.star.awt.XToolkit.class, m_orb.createInstance( "com.sun.star.awt.Toolkit" ) );
com.sun.star.awt.WindowDescriptor windowDescriptor = new com.sun.star.awt.WindowDescriptor();
@@ -161,7 +161,7 @@ public class ObjectInspector extends complexlib.ComplexTestCase
+ com.sun.star.awt.WindowAttribute.CLOSEABLE
+ com.sun.star.awt.VclWindowPeerAttribute.CLIPCHILDREN;
- return (com.sun.star.awt.XWindow)UnoRuntime.queryInterface( com.sun.star.awt.XWindow.class,
+ return UnoRuntime.queryInterface( com.sun.star.awt.XWindow.class,
toolkit.createWindow( windowDescriptor ) );
}
}
diff --git a/extensions/qa/integration/extensions/ServicesHandler.java b/extensions/qa/integration/extensions/ServicesHandler.java
index 6033b11c2277..87ebb270ae84 100644
--- a/extensions/qa/integration/extensions/ServicesHandler.java
+++ b/extensions/qa/integration/extensions/ServicesHandler.java
@@ -56,7 +56,7 @@ public class ServicesHandler implements XPropertyHandler
// the OpenHyperlink command, to be dispatched to the Desktop
com.sun.star.util.URL dispatchURL[] = { new com.sun.star.util.URL() };
dispatchURL[0].Complete = ".uno:OpenHyperlink";
- com.sun.star.util.XURLTransformer transformer = (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
+ com.sun.star.util.XURLTransformer transformer = UnoRuntime.queryInterface(
com.sun.star.util.XURLTransformer.class,
m_context.getServiceManager().createInstanceWithContext( "com.sun.star.util.URLTransformer", m_context ) );
transformer.parseStrict( dispatchURL );
@@ -123,7 +123,7 @@ public class ServicesHandler implements XPropertyHandler
descriptor.IndentLevel = 0;
try
{
- XHyperlinkControl hyperlinkControl = (XHyperlinkControl)UnoRuntime.queryInterface(
+ XHyperlinkControl hyperlinkControl = UnoRuntime.queryInterface(
XHyperlinkControl.class, _propertyControlFactory.createPropertyControl( PropertyControlType.HyperlinkField, true ) );
hyperlinkControl.addActionListener( new ClickHandler( m_context, _propertyName ) );
@@ -174,7 +174,7 @@ public class ServicesHandler implements XPropertyHandler
public void inspect(Object _component) throws com.sun.star.lang.NullPointerException
{
- XServiceInfo serviceInfo = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, _component );
+ XServiceInfo serviceInfo = UnoRuntime.queryInterface( XServiceInfo.class, _component );
if ( serviceInfo != null )
m_supportedServices = serviceInfo.getSupportedServiceNames();
}
diff --git a/extensions/test/pgp/TestPGP.java b/extensions/test/pgp/TestPGP.java
index 9559f1c18480..78d4285f707d 100644
--- a/extensions/test/pgp/TestPGP.java
+++ b/extensions/test/pgp/TestPGP.java
@@ -41,18 +41,18 @@ public class TestPGP {
static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException, Exception {
- 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 !");
}
- XSet set= (XSet)UnoRuntime.queryInterface(XSet.class, rSmgr);
+ XSet set= UnoRuntime.queryInterface(XSet.class, rSmgr);
if( set == null) {
System.err.println(" couldn't get XSet from ServiceFactory");
return;