You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/01/24 23:16:23 UTC
svn commit: r126320 - /lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java
Author: gregor
Date: Mon Jan 24 14:16:21 2005
New Revision: 126320
URL: http://svn.apache.org/viewcvs?view=rev&rev=126320
Log:
Fixed code that tried to delete a file that was still referenced in an open file stream. This fixes http://issues.apache.org/bugzilla/show_bug.cgi?id=31986
Modified:
lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java
Modified: lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java?view=diff&rev=126320&p1=lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java&r1=126319&p2=lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java&r2=126320
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/workflow/impl/History.java Mon Jan 24 14:16:21 2005
@@ -23,8 +23,6 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -387,6 +385,8 @@
destinationChannel = destinationStream.getChannel();
destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
+ sourceStream.close();
+ destinationStream.close();
File directory = historyFile.getParentFile();
boolean deleted = historyFile.delete();
if (!deleted) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org