diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java | 45 |
1 files changed, 16 insertions, 29 deletions
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; |