summaryrefslogtreecommitdiffstats
path: root/qadevOOo/runner/util/DBTools.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-27 16:08:28 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:03:01 +0200
commit453d7edc424d6652e209ace4915d96193a79be71 (patch)
tree0a6af928cf7d1fd90ec995ae7d114f08eaf617fd /qadevOOo/runner/util/DBTools.java
parentJava5 update - usage generics where possible (diff)
downloadcore-453d7edc424d6652e209ace4915d96193a79be71.tar.gz
core-453d7edc424d6652e209ace4915d96193a79be71.zip
Java5 update - convert more code to use generics:wq
Change-Id: I7ea32cad40a6657e4e5886d04af008cb6d67ac6e
Diffstat (limited to 'qadevOOo/runner/util/DBTools.java')
-rw-r--r--qadevOOo/runner/util/DBTools.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/qadevOOo/runner/util/DBTools.java b/qadevOOo/runner/util/DBTools.java
index 30c1b230548f..98e699cef28b 100644
--- a/qadevOOo/runner/util/DBTools.java
+++ b/qadevOOo/runner/util/DBTools.java
@@ -166,8 +166,7 @@ public class DBTools {
* class fields.
*/
public DataSourceInfo(Object dataSource) {
- XPropertySet xProps = (XPropertySet)
- UnoRuntime.queryInterface(XPropertySet.class, dataSource) ;
+ XPropertySet xProps = UnoRuntime.queryInterface(XPropertySet.class, dataSource) ;
try {
Name = (String)xProps.getPropertyValue("Name") ;
@@ -244,7 +243,7 @@ public class DBTools {
{
Object src = src = xMSF.createInstance("com.sun.star.sdb.DataSource") ;
- XPropertySet props = (XPropertySet) UnoRuntime.queryInterface
+ XPropertySet props = UnoRuntime.queryInterface
(XPropertySet.class, src) ;
if (Name != null) props.setPropertyValue("Name", Name) ;
@@ -340,8 +339,7 @@ public class DBTools {
XInterface newSource = (XInterface) xMSF.createInstance
("com.sun.star.sdb.DataSource") ;
- XPropertySet xSrcProp = (XPropertySet)
- UnoRuntime.queryInterface(XPropertySet.class, newSource);
+ XPropertySet xSrcProp = UnoRuntime.queryInterface(XPropertySet.class, newSource);
xSrcProp.setPropertyValue("URL", "sdbc:text:" + dirToUrl(dbDir));
@@ -383,8 +381,7 @@ public class DBTools {
XInterface newSource = (XInterface) xMSF.createInstance
("com.sun.star.sdb.DataSource") ;
- XPropertySet xSrcProp = (XPropertySet)
- UnoRuntime.queryInterface(XPropertySet.class, newSource);
+ XPropertySet xSrcProp = UnoRuntime.queryInterface(XPropertySet.class, newSource);
xSrcProp.setPropertyValue("URL", "sdbc:dbase:" + dirToUrl(dbDir));
dbContext.registerObject(contextName, newSource) ;
@@ -444,14 +441,14 @@ public class DBTools {
String existURL = null ;
- XNameAccess na = (XNameAccess) UnoRuntime.queryInterface
+ XNameAccess na = UnoRuntime.queryInterface
(XNameAccess.class, dbContext) ;
Object src = null ;
if (na.hasByName("APITestDatabase")) {
src = dbContext.getRegisteredObject("APITestDatabase") ;
- XPropertySet srcPs = (XPropertySet) UnoRuntime.queryInterface
+ XPropertySet srcPs = UnoRuntime.queryInterface
(XPropertySet.class, src) ;
existURL = (String) srcPs.getPropertyValue("URL") ;