summaryrefslogtreecommitdiff
path: root/odk/examples/java/Storage/TestHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'odk/examples/java/Storage/TestHelper.java')
-rw-r--r--odk/examples/java/Storage/TestHelper.java44
1 files changed, 22 insertions, 22 deletions
diff --git a/odk/examples/java/Storage/TestHelper.java b/odk/examples/java/Storage/TestHelper.java
index 935e0b4a9785..ac0c3b9c2d03 100644
--- a/odk/examples/java/Storage/TestHelper.java
+++ b/odk/examples/java/Storage/TestHelper.java
@@ -49,7 +49,7 @@ public class TestHelper {
}
// get XTrucate implementation from output stream
- XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xOutput );
+ XTruncate xTruncate = UnoRuntime.queryInterface( XTruncate.class, xOutput );
if ( xTruncate == null )
{
Error( "Can't get XTruncate implementation from substream '" + sStreamName + "'!" );
@@ -69,7 +69,7 @@ public class TestHelper {
}
// get access to the XPropertySet interface
- XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xStream );
+ XPropertySet xPropSet = UnoRuntime.queryInterface( XPropertySet.class, xStream );
if ( xPropSet == null )
{
Error( "Can't get XPropertySet implementation from substream '" + sStreamName + "'!" );
@@ -105,7 +105,7 @@ public class TestHelper {
}
// free the stream resources, garbage collector may remove the object too late
- XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, xStream );
+ XComponent xComponent = UnoRuntime.queryInterface( XComponent.class, xStream );
if ( xComponent == null )
{
Error( "Can't get XComponent implementation from substream '" + sStreamName + "'!" );
@@ -128,7 +128,7 @@ public class TestHelper {
try
{
Object oSubStream = xStorage.openStreamElement( sStreamName, ElementModes.WRITE );
- xSubStream = (XStream) UnoRuntime.queryInterface( XStream.class, oSubStream );
+ xSubStream = UnoRuntime.queryInterface( XStream.class, oSubStream );
if ( xSubStream == null )
{
Error( "Can't create substream '" + sStreamName + "'!" );
@@ -156,7 +156,7 @@ public class TestHelper {
try
{
Object oSubStream = xStorage.openEncryptedStreamElement( sStreamName, ElementModes.WRITE, new String(pPass) );
- xSubStream = (XStream) UnoRuntime.queryInterface( XStream.class, oSubStream );
+ xSubStream = UnoRuntime.queryInterface( XStream.class, oSubStream );
if ( xSubStream == null )
{
Error( "Can't create substream '" + sStreamName + "'!" );
@@ -184,7 +184,7 @@ public class TestHelper {
try
{
Object oSubStream = xStorage.openStreamElement( sStreamName, ElementModes.WRITE );
- xSubStream = (XStream) UnoRuntime.queryInterface( XStream.class, oSubStream );
+ xSubStream = UnoRuntime.queryInterface( XStream.class, oSubStream );
if ( xSubStream == null )
{
Error( "Can't create substream '" + sStreamName + "'!" );
@@ -198,7 +198,7 @@ public class TestHelper {
}
// get access to the XPropertySet interface
- XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xSubStream );
+ XPropertySet xPropSet = UnoRuntime.queryInterface( XPropertySet.class, xSubStream );
if ( xPropSet == null )
{
Error( "Can't get XPropertySet implementation from substream '" + sStreamName + "'!" );
@@ -229,7 +229,7 @@ public class TestHelper {
try
{
Object oSubStream = xStorage.openEncryptedStreamElement( sStreamName, ElementModes.WRITE, new String(pOldPass) );
- xSubStream = (XStream) UnoRuntime.queryInterface( XStream.class, oSubStream );
+ xSubStream = UnoRuntime.queryInterface( XStream.class, oSubStream );
if ( xSubStream == null )
{
Error( "Can't open substream '" + sStreamName + "'!" );
@@ -245,7 +245,7 @@ public class TestHelper {
// change the password for the stream
XEncryptionProtectedSource xStreamEncryption =
- (XEncryptionProtectedSource) UnoRuntime.queryInterface( XEncryptionProtectedSource.class, xSubStream );
+ UnoRuntime.queryInterface( XEncryptionProtectedSource.class, xSubStream );
if ( xStreamEncryption == null )
{
@@ -263,7 +263,7 @@ public class TestHelper {
}
// free the stream resources, garbage collector may remove the object too late
- XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, xSubStream );
+ XComponent xComponent = UnoRuntime.queryInterface( XComponent.class, xSubStream );
if ( xComponent == null )
{
Error( "Can't get XComponent implementation from substream '" + sStreamName + "'!" );
@@ -279,7 +279,7 @@ public class TestHelper {
boolean bOk = false;
// get access to the XPropertySet interface
- XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xStorage );
+ XPropertySet xPropSet = UnoRuntime.queryInterface( XPropertySet.class, xStorage );
if ( xPropSet != null )
{
try
@@ -323,7 +323,7 @@ public class TestHelper {
boolean bOk = false;
// get access to the XPropertySet interface
- XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xStorage );
+ XPropertySet xPropSet = UnoRuntime.queryInterface( XPropertySet.class, xStorage );
if ( xPropSet != null )
{
try
@@ -421,7 +421,7 @@ public class TestHelper {
boolean bOk = false;
// get access to the XPropertySet interface
- XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xStream );
+ XPropertySet xPropSet = UnoRuntime.queryInterface( XPropertySet.class, xStream );
if ( xPropSet != null )
{
try
@@ -467,7 +467,7 @@ public class TestHelper {
try
{
Object oSubStream = xParentStorage.openStreamElement( sName, ElementModes.READ );
- xSubStream = (XStream) UnoRuntime.queryInterface( XStream.class, oSubStream );
+ xSubStream = UnoRuntime.queryInterface( XStream.class, oSubStream );
if ( xSubStream == null )
{
Error( "Can't open substream '" + sName + "'!" );
@@ -532,7 +532,7 @@ public class TestHelper {
try
{
Object oSubStream = xParentStorage.openEncryptedStreamElement( sName, ElementModes.READ, new String(pPass) );
- xSubStream = (XStream) UnoRuntime.queryInterface( XStream.class, oSubStream );
+ xSubStream = UnoRuntime.queryInterface( XStream.class, oSubStream );
if ( xSubStream == null )
{
Error( "Can't open encrypted substream '" + sName + "'!" );
@@ -567,7 +567,7 @@ public class TestHelper {
public boolean commitStorage( XStorage xStorage )
{
// XTransactedObject must be supported by storages
- XTransactedObject xTransact = (XTransactedObject) UnoRuntime.queryInterface( XTransactedObject.class, xStorage );
+ XTransactedObject xTransact = UnoRuntime.queryInterface( XTransactedObject.class, xStorage );
if ( xTransact == null )
{
Error( "Storage doesn't implement transacted access!" );
@@ -590,7 +590,7 @@ public class TestHelper {
public boolean disposeStorage( XStorage xStorage )
{
// dispose the storage
- XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, xStorage );
+ XComponent xComponent = UnoRuntime.queryInterface( XComponent.class, xStorage );
if ( xComponent == null )
{
Error( "Can't retrieve XComponent implementation from storage!" );
@@ -664,7 +664,7 @@ public class TestHelper {
try
{
Object oSubStorage = xStorage.openStorageElement( sName, nMode );
- XStorage xSubStorage = (XStorage) UnoRuntime.queryInterface( XStorage.class, oSubStorage );
+ XStorage xSubStorage = UnoRuntime.queryInterface( XStorage.class, oSubStorage );
return xSubStorage;
}
catch( Exception e )
@@ -682,7 +682,7 @@ public class TestHelper {
try
{
Object oTempFile = xMSF.createInstance( "com.sun.star.io.TempFile" );
- xTempFileStream = (XStream)UnoRuntime.queryInterface( XStream.class, oTempFile );
+ xTempFileStream = UnoRuntime.queryInterface( XStream.class, oTempFile );
}
catch( Exception e )
{}
@@ -702,7 +702,7 @@ public class TestHelper {
try
{
Object oTempFile = xMSF.createInstance( "com.sun.star.io.TempFile" );
- xTempFileProps = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, oTempFile );
+ xTempFileProps = UnoRuntime.queryInterface( XPropertySet.class, oTempFile );
}
catch( Exception e )
{}
@@ -727,7 +727,7 @@ public class TestHelper {
// close temporary file explicitly
try
{
- XStream xStream = (XStream)UnoRuntime.queryInterface( XStream.class, xTempFileProps );
+ XStream xStream = UnoRuntime.queryInterface( XStream.class, xTempFileProps );
if ( xStream != null )
{
XOutputStream xOut = xStream.getOutputStream();
@@ -822,7 +822,7 @@ public class TestHelper {
try
{
Object oSubStream = xStorage.openStreamElement( sStreamName, nMode );
- xSubStream = (XStream) UnoRuntime.queryInterface( XStream.class, oSubStream );
+ xSubStream = UnoRuntime.queryInterface( XStream.class, oSubStream );
if ( xSubStream == null )
Error( "Can't create substream '" + sStreamName + "'!" );
}