Kaydet (Commit) 8cde093e authored tarafından Stephan Wunderlich's avatar Stephan Wunderlich

CHG: using AnyConverter instead of simple cast

üst 4af95888
......@@ -2,9 +2,9 @@
*
* $RCSfile: CachedContentResultSetStubFactory.java,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change:$Date: 2003-01-27 18:14:22 $
* last change:$Date: 2003-01-31 09:57:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -76,6 +76,8 @@ import com.sun.star.ucb.XContentProvider;
import com.sun.star.ucb.XDynamicResultSet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.Type;
import com.sun.star.uno.AnyConverter;
import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase;
......@@ -188,8 +190,14 @@ public class CachedContentResultSetStubFactory extends TestCase {
(OpenMode.ALL, 10000, null, new Property[] {prop},
new NumberedSortingInfo[0])) ;
XDynamicResultSet dynResSet = (XDynamicResultSet)
cmdProc.execute(cmd, 0, null) ;
XDynamicResultSet dynResSet = null;
try {
dynResSet = (XDynamicResultSet)
AnyConverter.toObject(new Type(XDynamicResultSet.class),
cmdProc.execute(cmd, 0, null));
} catch (com.sun.star.lang.IllegalArgumentException iae) {
throw new StatusException("Couldn't convert Any ",iae);
}
resSet = dynResSet.getStaticResultSet() ;
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: CachedDynamicResultSetFactory.java,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change:$Date: 2003-01-27 18:14:21 $
* last change:$Date: 2003-01-31 10:01:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -76,6 +76,8 @@ import com.sun.star.ucb.XContentProvider;
import com.sun.star.ucb.XDynamicResultSet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.Type;
import com.sun.star.uno.AnyConverter;
import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase;
......@@ -187,8 +189,14 @@ public class CachedDynamicResultSetFactory extends TestCase {
(OpenMode.ALL, 10000, null, new Property[] {prop},
new NumberedSortingInfo[0])) ;
XDynamicResultSet dynResSet = (XDynamicResultSet)
cmdProc.execute(cmd, 0, null) ;
XDynamicResultSet dynResSet = null;
try {
dynResSet = (XDynamicResultSet)
AnyConverter.toObject(new Type(XDynamicResultSet.class),
cmdProc.execute(cmd, 0, null));
} catch (com.sun.star.lang.IllegalArgumentException iae) {
throw new StatusException("Couldn't convert Any ",iae);
}
Object oStubFactory = xMSF.createInstance
("com.sun.star.ucb.CachedDynamicResultSetStubFactory") ;
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: CachedDynamicResultSetStubFactory.java,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change:$Date: 2003-01-27 18:14:21 $
* last change:$Date: 2003-01-31 10:04:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -75,6 +75,8 @@ import com.sun.star.ucb.XContentProvider;
import com.sun.star.ucb.XDynamicResultSet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.Type;
import com.sun.star.uno.AnyConverter;
import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase;
......@@ -184,7 +186,14 @@ public class CachedDynamicResultSetStubFactory extends TestCase {
(OpenMode.ALL, 10000, null, new Property[] {prop},
new NumberedSortingInfo[0])) ;
dynResSet = (XDynamicResultSet) cmdProc.execute(cmd, 0, null) ;
dynResSet = null;
try {
dynResSet = (XDynamicResultSet)
AnyConverter.toObject(new Type(XDynamicResultSet.class),
cmdProc.execute(cmd, 0, null));
} catch (com.sun.star.lang.IllegalArgumentException iae) {
throw new StatusException("Couldn't convert Any ",iae);
}
} catch (com.sun.star.uno.Exception e) {
log.println("Can't create relation." );
......@@ -197,5 +206,4 @@ public class CachedDynamicResultSetStubFactory extends TestCase {
return tEnv;
} // finish method getTestEnvironment
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment