diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-01 16:12:26 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-01 14:13:50 +0000 |
commit | a30022e17cbf5b378c1074ce587b3ff40ac6f92c (patch) | |
tree | 1fd9037320b21daa0eb8619d0dc0b6f70c0ed1e1 /connectivity/qa | |
parent | fdo#84550 Make 'Insert field' entry dropdown only (diff) | |
download | core-a30022e17cbf5b378c1074ce587b3ff40ac6f92c.tar.gz core-a30022e17cbf5b378c1074ce587b3ff40ac6f92c.zip |
connectivity: the assigned value is never used
Change-Id: I6e4d2fc6563f0ff1a65e114d018675c314a04fd6
Reviewed-on: https://gerrit.libreoffice.org/11741
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'connectivity/qa')
-rw-r--r-- | connectivity/qa/complex/connectivity/HsqlDriverTest.java | 13 | ||||
-rw-r--r-- | connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java | 6 |
2 files changed, 7 insertions, 12 deletions
diff --git a/connectivity/qa/complex/connectivity/HsqlDriverTest.java b/connectivity/qa/complex/connectivity/HsqlDriverTest.java index a0ff160b1fb8..5a399a2de362 100644 --- a/connectivity/qa/complex/connectivity/HsqlDriverTest.java +++ b/connectivity/qa/complex/connectivity/HsqlDriverTest.java @@ -88,17 +88,15 @@ public class HsqlDriverTest extends ComplexTestCase { xComp.dispose(); } catch(Exception e){} - com.sun.star.beans.PropertyValue[] info = null; - XDriver drv = null; try{ XDocumentSubStorageSupplier doc = UnoRuntime.queryInterface(XDocumentSubStorageSupplier.class,ds); XModel mod = UnoRuntime.queryInterface(XModel.class,ds); XStorage stor = doc.getDocumentSubStorage("database",4); - info = new com.sun.star.beans.PropertyValue[]{ + com.sun.star.beans.PropertyValue[] info = new com.sun.star.beans.PropertyValue[]{ new com.sun.star.beans.PropertyValue("Storage",0,stor,PropertyState.DIRECT_VALUE) ,new com.sun.star.beans.PropertyValue("URL",0,mod.getURL(),PropertyState.DIRECT_VALUE) }; - drv = UnoRuntime.queryInterface(XDriver.class,param.getMSF().createInstance("com.sun.star.sdbcx.comp.hsqldb.Driver")); + XDriver drv = UnoRuntime.queryInterface(XDriver.class,param.getMSF().createInstance("com.sun.star.sdbcx.comp.hsqldb.Driver")); TestCacheSize test = new TestCacheSize((param.getMSF()),info,drv); @@ -119,17 +117,16 @@ public class HsqlDriverTest extends ComplexTestCase { } catch(Exception e){} }catch(Exception e){} } + public void test2(){ System.gc(); - com.sun.star.beans.PropertyValue[] info = null; - XDriver drv = null; try{ - info = new com.sun.star.beans.PropertyValue[]{ + com.sun.star.beans.PropertyValue[] info = new com.sun.star.beans.PropertyValue[]{ new com.sun.star.beans.PropertyValue("JavaDriverClass",0,"org.hsqldb.jdbcDriver",PropertyState.DIRECT_VALUE) ,new com.sun.star.beans.PropertyValue("ParameterNameSubstitution",0, false,PropertyState.DIRECT_VALUE) }; - drv = UnoRuntime.queryInterface(XDriver.class,param.getMSF().createInstance("com.sun.star.comp.sdbc.JDBCDriver")); + XDriver drv = UnoRuntime.queryInterface(XDriver.class,param.getMSF().createInstance("com.sun.star.comp.sdbc.JDBCDriver")); TestCacheSize test = new TestCacheSize((param.getMSF()),info,drv); test.setURL("jdbc:hsqldb:g:\\hsql\\db"); diff --git a/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java index 9b827529a4e2..a44f1b9d1241 100644 --- a/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java +++ b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java @@ -58,7 +58,6 @@ public class JdbcLongVarCharTest extends ComplexTestCase System.out.println("== Start testing =="); String url = "jdbc:mysql://localhost:3306/mysql?user=root"; - com.sun.star.sdbc.XConnection xConnection = null; com.sun.star.beans.PropertyValue prop[] = new PropertyValue[1]; prop[0] = new PropertyValue("JavaDriverClass", 0, "com.mysql.jdbc.Driver", PropertyState.DIRECT_VALUE); @@ -67,7 +66,7 @@ public class JdbcLongVarCharTest extends ComplexTestCase Object x = xServiceManager.createInstance("com.sun.star.sdbc.DriverManager"); com.sun.star.sdbc.XDriverAccess xDriverAccess = UnoRuntime.queryInterface(XDriverAccess.class, x); com.sun.star.sdbc.XDriver xDriver = xDriverAccess.getDriverByURL(url); - xConnection = xDriver.connect(url, prop); + com.sun.star.sdbc.XConnection xConnection = xDriver.connect(url, prop); Object prepStmnt = xConnection.prepareStatement("SELECT * FROM i90114 WHERE i90114.c1 = ?"); UnoRuntime.queryInterface(XParameters.class, prepStmnt).clearParameters(); @@ -91,8 +90,7 @@ public class JdbcLongVarCharTest extends ComplexTestCase { String str = "not set"; - XClob xClob = null; - xClob = xRow.getClob(2); + XClob xClob = xRow.getClob(2); if (xClob != null) { System.out.println("xClob != null"); |