lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1140504 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/CHANGES.txt lucene/backwards/ lucene/backwards/src/test-framework/ lucene/backwards/src/test/ lucene/src/java/org/apache/lucene/store/Directory.java solr/
Date Tue, 28 Jun 2011 09:51:50 GMT
Author: simonw
Date: Tue Jun 28 09:51:49 2011
New Revision: 1140504

URL: http://svn.apache.org/viewvc?rev=1140504&view=rev
Log:
LUCENE-3251: Directory#copy leaks file handles

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/CHANGES.txt
    lucene/dev/branches/branch_3x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test-framework/   (props changed)
    lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/store/Directory.java
    lucene/dev/branches/branch_3x/solr/   (props changed)

Modified: lucene/dev/branches/branch_3x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/CHANGES.txt?rev=1140504&r1=1140503&r2=1140504&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/lucene/CHANGES.txt Tue Jun 28 09:51:49 2011
@@ -5,6 +5,11 @@ http://s.apache.org/luceneversions
 
 ======================= Lucene 3.x (not yet released) ================
 
+Bug fixes
+
+* LUCENE-3251: Directory#copy failed to close target output if opening the
+  source stream failed. (Simon Willnauer)
+
 Optimizations
   
 * LUCENE-3201, LUCENE-3218: CompoundFileSystem code has been consolidated 

Modified: lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/store/Directory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/store/Directory.java?rev=1140504&r1=1140503&r2=1140504&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/store/Directory.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/store/Directory.java Tue
Jun 28 09:51:49 2011
@@ -249,10 +249,12 @@ public abstract class Directory implemen
    * overwrite it if it does.
    */
   public void copy(Directory to, String src, String dest) throws IOException {
-    IndexOutput os = to.createOutput(dest);
-    IndexInput is = openInput(src);
+    IndexOutput os = null;
+    IndexInput is = null;
     IOException priorException = null;
     try {
+      os = to.createOutput(dest);
+      is = openInput(src);
       is.copyBytes(os, is.length());
     } catch (IOException ioe) {
       priorException = ioe;



Mime
View raw message