[Libreoffice-commits] core.git: connectivity/qa

Robert Antoni Buj i Gelonch robert.buj at gmail.com
Wed Oct 1 07:14:14 PDT 2014


 connectivity/qa/complex/connectivity/HsqlDriverTest.java      |   13 +++-------
 connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java |    6 +---
 2 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit a30022e17cbf5b378c1074ce587b3ff40ac6f92c
Author: Robert Antoni Buj i Gelonch <robert.buj at gmail.com>
Date:   Wed Oct 1 16:12:26 2014 +0200

    connectivity: the assigned value is never used
    
    Change-Id: I6e4d2fc6563f0ff1a65e114d018675c314a04fd6
    Reviewed-on: https://gerrit.libreoffice.org/11741
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/connectivity/qa/complex/connectivity/HsqlDriverTest.java b/connectivity/qa/complex/connectivity/HsqlDriverTest.java
index a0ff160..5a399a2 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 9b82752..a44f1b9 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");


More information about the Libreoffice-commits mailing list