summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-17 14:59:35 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-19 07:52:08 +0000
commit8d87758d65e4a03271f76e354dfc84c1fcd5fe21 (patch)
treebc8f4f0df6981ad10fe1333db1a2b015ea079709 /qadevOOo
parentd62425cc27e04a3237cfec2ea2663b8b11284ec8 (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 'qadevOOo')
-rw-r--r--qadevOOo/tests/java/mod/_regtypeprov/uno/RegistryTypeDescriptionProvider.java10
-rw-r--r--qadevOOo/tests/java/mod/_remotebridge/uno/various.java15
-rw-r--r--qadevOOo/tests/java/mod/_servicemgr/uno/OServiceManager.java6
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java15
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java16
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java12
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java19
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java39
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java45
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/Pipe.java3
-rw-r--r--qadevOOo/tests/java/mod/_streams/uno/Pump.java6
-rw-r--r--qadevOOo/tests/java/mod/_typemgr/uno/TypeDescriptionManager.java7
12 files changed, 72 insertions, 121 deletions
diff --git a/qadevOOo/tests/java/mod/_regtypeprov/uno/RegistryTypeDescriptionProvider.java b/qadevOOo/tests/java/mod/_regtypeprov/uno/RegistryTypeDescriptionProvider.java
index f81b9806224e..9f1d9d594022 100644
--- a/qadevOOo/tests/java/mod/_regtypeprov/uno/RegistryTypeDescriptionProvider.java
+++ b/qadevOOo/tests/java/mod/_regtypeprov/uno/RegistryTypeDescriptionProvider.java
@@ -73,18 +73,16 @@ public class RegistryTypeDescriptionProvider 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 type description manager
Object o = xContext.getValueByName("/singletons/" +
"com.sun.star.reflection.theTypeDescriptionManager");
// the manager contains all providers
- XEnumerationAccess aProviderAccess = (XEnumerationAccess)
- UnoRuntime.queryInterface(XEnumerationAccess.class, o);
+ XEnumerationAccess aProviderAccess = UnoRuntime.queryInterface(XEnumerationAccess.class, o);
// collect enumeration
XEnumeration xProviderEnum;
if (aProviderAccess.hasElements())
diff --git a/qadevOOo/tests/java/mod/_remotebridge/uno/various.java b/qadevOOo/tests/java/mod/_remotebridge/uno/various.java
index f2d722213daa..3a44607ead1e 100644
--- a/qadevOOo/tests/java/mod/_remotebridge/uno/various.java
+++ b/qadevOOo/tests/java/mod/_remotebridge/uno/various.java
@@ -203,19 +203,18 @@ public class various extends TestCase {
XInterface oAcctr = (XInterface)xMSF.createInstance(
"com.sun.star.connection.Acceptor") ;
- xAcctr = (XAcceptor)UnoRuntime.queryInterface(
+ xAcctr = UnoRuntime.queryInterface(
XAcceptor.class, oAcctr);
// create connector
XInterface oCntr = (XInterface)xMSF.createInstance(
"com.sun.star.connection.Connector") ;
- xCntr = (XConnector)UnoRuntime.queryInterface(
+ xCntr = UnoRuntime.queryInterface(
XConnector.class, oCntr);
// create bridge factory
XInterface oBrdg = (XInterface)xMSF.createInstance(
"com.sun.star.bridge.BridgeFactory") ;
- xBrdgFctr = (XBridgeFactory)
- UnoRuntime.queryInterface(XBridgeFactory.class, oBrdg);
+ xBrdgFctr = UnoRuntime.queryInterface(XBridgeFactory.class, oBrdg);
// create own implementation of XInstanceProvider
XInstanceProvider xInstProv = new MyInstanceProvider(xMSF);
@@ -267,20 +266,20 @@ public class various extends TestCase {
if (accThread.isAlive()) {
accThread.interrupt();
}
- XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent xComp = UnoRuntime.queryInterface(
XComponent.class, xAcctr);
if (xComp != null)
xComp.dispose();
- xComp = (XComponent)UnoRuntime.queryInterface(
+ xComp = UnoRuntime.queryInterface(
XComponent.class, xCntr);
if (xComp != null)
xComp.dispose();
- xComp = (XComponent)UnoRuntime.queryInterface(
+ xComp = UnoRuntime.queryInterface(
XComponent.class, xBrdgFctr);
if (xComp != null)
xComp.dispose();
- xComp = (XComponent)UnoRuntime.queryInterface(
+ xComp = UnoRuntime.queryInterface(
XComponent.class, bridge);
if (xComp != null) {
System.out.println("######## Dispose bridge");
diff --git a/qadevOOo/tests/java/mod/_servicemgr/uno/OServiceManager.java b/qadevOOo/tests/java/mod/_servicemgr/uno/OServiceManager.java
index 31bff2937c5d..5d2f34b07201 100644
--- a/qadevOOo/tests/java/mod/_servicemgr/uno/OServiceManager.java
+++ b/qadevOOo/tests/java/mod/_servicemgr/uno/OServiceManager.java
@@ -115,9 +115,9 @@ public class OServiceManager extends TestCase {
}
try {
- XSet set = (XSet) UnoRuntime.queryInterface
+ XSet set = UnoRuntime.queryInterface
(XSet.class, oInterface) ;
- XSet set1 = (XSet) UnoRuntime.queryInterface
+ XSet set1 = UnoRuntime.queryInterface
(XSet.class, srvMan) ;
XEnumeration oEnum = set1.createEnumeration();
Object srv = oEnum.nextElement();
@@ -126,7 +126,7 @@ public class OServiceManager extends TestCase {
newElement = oEnum.nextElement();
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet xProp = UnoRuntime.queryInterface(
XPropertySet.class, oInterface);
if (xProp != null) {
xContext = (XComponentContext) AnyConverter.toObject(
diff --git a/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java
index ec16d4046d2e..63eef1a645b1 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java
@@ -93,8 +93,7 @@ public class DataInputStream extends TestCase {
// creating and connecting DataOutputStream to the
// DataInputStream created through the Pipe
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
XInterface oPipe = null;
try {
@@ -105,10 +104,8 @@ public class DataInputStream extends TestCase {
throw new StatusException("Couldn't create instance", e);
}
- XInputStream xPipeInput = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, oPipe);
- XOutputStream xPipeOutput = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+ XInputStream xPipeInput = UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe);
XInterface oDataOutput = null;
try {
@@ -119,10 +116,8 @@ public class DataInputStream extends TestCase {
throw new StatusException("Couldn't create instance", e);
}
- XDataOutputStream xDataOutput = (XDataOutputStream)
- UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ;
- XActiveDataSource xDataSource = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ;
+ XDataOutputStream xDataOutput = UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ;
+ XActiveDataSource xDataSource = UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ;
xDataSource.setOutputStream(xPipeOutput) ;
xDataSink.setInputStream(xPipeInput) ;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java
index 177ce4bd0001..85cc334414cc 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java
@@ -93,11 +93,9 @@ public class DataOutputStream extends TestCase {
oObj = (XInterface) oInterface;
- final XOutputStream xPipeOutput = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, oPipe);
+ final XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe);
- XActiveDataSource xDataSource = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+ XActiveDataSource xDataSource = UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
xDataSource.setOutputStream(xPipeOutput);
@@ -124,8 +122,7 @@ public class DataOutputStream extends TestCase {
//add relation for io.XOutputStream
final XMultiServiceFactory msf = xMSF;
- final XInputStream xPipeInput = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, oPipe);
+ final XInputStream xPipeInput = UnoRuntime.queryInterface(XInputStream.class, oPipe);
tEnv.addObjRelation("XOutputStream.StreamChecker",
new ifc.io._XOutputStream.StreamChecker() {
XInputStream xInStream = null;
@@ -149,15 +146,14 @@ public class DataOutputStream extends TestCase {
try {
Object oInStream = msf.createInstance(
"com.sun.star.io.DataInputStream");
- xInStream = (XInputStream) UnoRuntime.queryInterface
+ xInStream = UnoRuntime.queryInterface
(XInputStream.class, oInStream);
} catch(com.sun.star.uno.Exception e) {
return null;
}
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(
- XActiveDataSink.class, xInStream);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
xDataSink.setInputStream(xPipeInput);
return xInStream;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java
index 971cfb44941a..8fc218e8acb3 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/MarkableInputStream.java
@@ -98,18 +98,14 @@ public class MarkableInputStream extends TestCase {
// Creating construction :
// MarkableOutputStream -> Pipe -> MarkableInputStream
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, aPipe);
- XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, aPipe);
+ XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class, aPipe);
xdSmo.setOutputStream(PipeOut);
- XActiveDataSink xmSi = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
xmSi.setInputStream(PipeIn) ;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java
index dd3666207da0..bfa0341a4c56 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java
@@ -109,18 +109,14 @@ public class MarkableOutputStream extends TestCase {
// Creating construction :
// MarkableOutputStream -> Pipe -> MarkableInputStream
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- final XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class,aPipe);
- final XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class,aPipe);
+ final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class,aPipe);
xdSmo.setOutputStream(PipeOut);
- XActiveDataSink xmSi = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
xmSi.setInputStream(PipeIn) ;
@@ -173,15 +169,14 @@ public class MarkableOutputStream extends TestCase {
try {
Object oInStream = msf.createInstance(
"com.sun.star.io.MarkableInputStream");
- xInStream = (XInputStream) UnoRuntime.queryInterface
+ xInStream = UnoRuntime.queryInterface
(XInputStream.class, oInStream);
} catch(com.sun.star.uno.Exception e) {
return null;
}
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(
- XActiveDataSink.class, xInStream);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
xDataSink.setInputStream(PipeIn);
return xInStream;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java
index 576076f87f2f..528a63031537 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java
@@ -96,9 +96,8 @@ public class ObjectInputStream extends TestCase {
try {
Object o = xMSF.createInstance(
"com.sun.star.registry.ImplementationRegistration");
- xir = (XImplementationRegistration)
- UnoRuntime.queryInterface(
- XImplementationRegistration.class, o);
+ xir = UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
}
catch (com.sun.star.uno.Exception e) {
@@ -189,7 +188,7 @@ public class ObjectInputStream extends TestCase {
("com.sun.star.io.MarkableInputStream");
mostream = xMSF.createInstance
("com.sun.star.io.MarkableOutputStream");
- xConnect = (XInterface)xMSF.createInstance
+ xConnect = xMSF.createInstance
("com.sun.star.io.DataInputStream") ;
} catch( com.sun.star.uno.Exception e ) {
@@ -199,35 +198,26 @@ public class ObjectInputStream extends TestCase {
// Creating construction :
// ObjectOutputStream -> MarkableOutputStream -> Pipe ->
// -> MarkableInputStream -> ObjectInputStream
- XActiveDataSource xdSo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+ XActiveDataSource xdSo = UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- XOutputStream moStream = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, mostream);
+ XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream);
- XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, aPipe);
- XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, aPipe);
+ XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe);
+ XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class, aPipe);
xdSo.setOutputStream(moStream);
xdSmo.setOutputStream(PipeOut);
- XObjectInputStream iStream = (XObjectInputStream)
- UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ XObjectInputStream iStream = UnoRuntime.queryInterface(XObjectInputStream.class, istream);
XObjectOutputStream oStream = null;
- oStream = (XObjectOutputStream)
- UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+ oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
- XActiveDataSink xmSi = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
- XInputStream xmIstream = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, mistream);
+ XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
+ XInputStream xmIstream = UnoRuntime.queryInterface(XInputStream.class, mistream);
- XActiveDataSink xdSi = (XActiveDataSink) UnoRuntime.queryInterface
+ XActiveDataSink xdSi = UnoRuntime.queryInterface
(XActiveDataSink.class, istream);
xdSi.setInputStream(xmIstream);
xmSi.setInputStream(PipeIn);
@@ -237,8 +227,7 @@ public class ObjectInputStream extends TestCase {
try {
Object oPersObj = xMSF.createInstance
("com.sun.star.cmp.PersistObject");
- xPersObj = (XPersistObject)
- UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ xPersObj = UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log);
throw new StatusException("Can't write persist object.", e);
diff --git a/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java
index f30870ec2d24..ff869a3973bd 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java
@@ -93,9 +93,8 @@ public class ObjectOutputStream extends TestCase {
try {
Object o = xMSF.createInstance(
"com.sun.star.registry.ImplementationRegistration");
- xir = (XImplementationRegistration)
- UnoRuntime.queryInterface(
- XImplementationRegistration.class, o);
+ xir = UnoRuntime.queryInterface(
+ XImplementationRegistration.class, o);
}
catch (com.sun.star.uno.Exception e) {
System.err.println(
@@ -191,44 +190,33 @@ public class ObjectOutputStream extends TestCase {
}
// creating the pipe where object has to be written to
- XActiveDataSource xdSo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
+ XActiveDataSource xdSo = UnoRuntime.queryInterface(XActiveDataSource.class, ostream);
- XActiveDataSource xdSmo = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
+ XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- XOutputStream moStream = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, mostream);
+ XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream);
- XActiveDataSink markIn = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, minstream);
- XActiveDataSink inStream = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, istream);
- XInputStream markInStream = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, minstream);
+ XActiveDataSink markIn = UnoRuntime.queryInterface(XActiveDataSink.class, minstream);
+ XActiveDataSink inStream = UnoRuntime.queryInterface(XActiveDataSink.class, istream);
+ XInputStream markInStream = UnoRuntime.queryInterface(XInputStream.class, minstream);
- final XOutputStream PipeOut = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class,aPipe);
- final XInputStream PipeIn = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class,aPipe);
+ final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe);
+ final XInputStream PipeIn = UnoRuntime.queryInterface(XInputStream.class,aPipe);
markIn.setInputStream(PipeIn);
inStream.setInputStream(markInStream);
- XObjectInputStream objInputStream = (XObjectInputStream)
- UnoRuntime.queryInterface(XObjectInputStream.class, istream);
+ XObjectInputStream objInputStream = UnoRuntime.queryInterface(XObjectInputStream.class, istream);
xdSo.setOutputStream(moStream);
xdSmo.setOutputStream(PipeOut);
- oStream = (XObjectOutputStream)
- UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
+ oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream);
// creating Persistent object which has to be written
XPersistObject xPersObj = null ;
try {
Object oPersObj = xMSF.createInstance
("com.sun.star.cmp.PersistObject");
- xPersObj = (XPersistObject)
- UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
+ xPersObj = UnoRuntime.queryInterface(XPersistObject.class, oPersObj);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log);
throw new StatusException("Can't write persist object.", e) ;
@@ -286,15 +274,14 @@ public class ObjectOutputStream extends TestCase {
try {
Object oInStream = msf.createInstance(
"com.sun.star.io.ObjectInputStream");
- xInStream = (XInputStream) UnoRuntime.queryInterface
+ xInStream = UnoRuntime.queryInterface
(XInputStream.class, oInStream);
} catch(com.sun.star.uno.Exception e) {
return null;
}
- XActiveDataSink xDataSink = (XActiveDataSink)
- UnoRuntime.queryInterface(
- XActiveDataSink.class, xInStream);
+ XActiveDataSink xDataSink = UnoRuntime.queryInterface(
+ XActiveDataSink.class, xInStream);
xDataSink.setInputStream(PipeIn);
return xInStream;
diff --git a/qadevOOo/tests/java/mod/_streams/uno/Pipe.java b/qadevOOo/tests/java/mod/_streams/uno/Pipe.java
index a4d32449de14..c4260ae00b5b 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/Pipe.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/Pipe.java
@@ -79,8 +79,7 @@ public class Pipe extends TestCase {
TestEnvironment tEnv = new TestEnvironment( oObj );
//add relation for io.XOutputStream
- final XInputStream iStream = (XInputStream)
- UnoRuntime.queryInterface(XInputStream.class, oObj);
+ final XInputStream iStream = UnoRuntime.queryInterface(XInputStream.class, oObj);
tEnv.addObjRelation("ByteData", byteData);
tEnv.addObjRelation("StreamWriter", oObj);
diff --git a/qadevOOo/tests/java/mod/_streams/uno/Pump.java b/qadevOOo/tests/java/mod/_streams/uno/Pump.java
index f953e557901c..de5eb1152dc4 100644
--- a/qadevOOo/tests/java/mod/_streams/uno/Pump.java
+++ b/qadevOOo/tests/java/mod/_streams/uno/Pump.java
@@ -83,10 +83,8 @@ public class Pump extends TestCase {
XInterface oObj = (XInterface) oInterface;
// setting up input and output streams for pump
- XActiveDataSink xSink = (XActiveDataSink)
- UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
- XActiveDataSource xSource = (XActiveDataSource)
- UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
+ XActiveDataSink xSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
+ XActiveDataSource xSource = UnoRuntime.queryInterface(XActiveDataSource.class, oObj);
XInputStream xInput = new MyInput();
XOutputStream xOutput = new MyOutput();
diff --git a/qadevOOo/tests/java/mod/_typemgr/uno/TypeDescriptionManager.java b/qadevOOo/tests/java/mod/_typemgr/uno/TypeDescriptionManager.java
index abee10a5029a..57b45152453b 100644
--- a/qadevOOo/tests/java/mod/_typemgr/uno/TypeDescriptionManager.java
+++ b/qadevOOo/tests/java/mod/_typemgr/uno/TypeDescriptionManager.java
@@ -43,12 +43,11 @@ public class TypeDescriptionManager 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 type description manager from context
oInterface = xContext.getValueByName("/singletons/" +
"com.sun.star.reflection.theTypeDescriptionManager");