db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1580587 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene: LuceneQueryVTI.java LuceneSupport.java
Date Sun, 23 Mar 2014 20:10:25 GMT
Author: rhillegas
Date: Sun Mar 23 20:10:25 2014
New Revision: 1580587

URL: http://svn.apache.org/r1580587
Log:
DERBY-590: Cleanup some suspect coding practices disclosed by running the Findbugs lint tool;
commit derby-590-02-aa-cleanupFindbugsErrors.diff.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneQueryVTI.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneSupport.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneQueryVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneQueryVTI.java?rev=1580587&r1=1580586&r2=1580587&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneQueryVTI.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneQueryVTI.java
Sun Mar 23 20:10:25 2014
@@ -362,7 +362,7 @@ public class LuceneQueryVTI extends Stri
 	/**
 	 * Be sure to close the Lucene IndexReader
 	 */
-	public void finalize()
+	protected void finalize()
     {
 		try {
 			if ( _indexReader != null ) { _indexReader.close(); }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneSupport.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneSupport.java?rev=1580587&r1=1580586&r2=1580587&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneSupport.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/optional/lucene/LuceneSupport.java
Sun Mar 23 20:10:25 2014
@@ -207,13 +207,16 @@ public class LuceneSupport implements Op
         String      className = getClass().getName();
         int             endPackageIdx = className.lastIndexOf( "." );
         String      packageName = className.substring( 0, endPackageIdx );
-        ResultSet   routines = conn.prepareStatement
+        PreparedStatement   ps = conn.prepareStatement
             (
              "select s.schemaName, a.alias, a.aliastype\n" +
              "from sys.sysschemas s, sys.sysaliases a\n" +
              "where s.schemaID = a.schemaID\n" +
-             "and substr( cast( a.javaclassname as varchar( 32672 ) ), 1, " + packageName.length()
+ " ) = '" + packageName + "'\n"
-             ).executeQuery();
+             "and substr( cast( a.javaclassname as varchar( 32672 ) ), 1, ? ) = ?\n"
+             );
+        ps.setInt( 1, packageName.length() );
+        ps.setString( 2, packageName );
+        ResultSet   routines = ps.executeQuery();
 
         try {
             while ( routines.next() )
@@ -415,7 +418,7 @@ public class LuceneSupport implements Op
             }
         
             query.append(", ");
-            query.append( textcol );
+            query.append( derbyIdentifier( textcol ) );
             query.append(" from " + makeTableName( schema, table ) );
 
             ps = conn.prepareStatement( query.toString() );



Mime
View raw message