You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/03/29 18:14:25 UTC
svn commit: r159384 -
lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowManagerImpl.java
Author: andreas
Date: Tue Mar 29 08:14:23 2005
New Revision: 159384
URL: http://svn.apache.org/viewcvs?view=rev&rev=159384
Log:
don't copy workflow history if it does not exist
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowManagerImpl.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowManagerImpl.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowManagerImpl.java?view=diff&r1=159383&r2=159384
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowManagerImpl.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowManagerImpl.java Tue Mar 29 08:14:23 2005
@@ -177,11 +177,12 @@
String sourceUri = ((DefaultDocument) source).getHistorySourceURI();
sourceHistory = sourceResolver.resolveURI(sourceUri);
-
- String targetUri = ((DefaultDocument) target).getHistorySourceURI();
- targetHistory = sourceResolver.resolveURI(targetUri);
- SourceUtil.copy(sourceHistory, (ModifiableSource) targetHistory, true);
+ if (sourceHistory.exists()) {
+ String targetUri = ((DefaultDocument) target).getHistorySourceURI();
+ targetHistory = sourceResolver.resolveURI(targetUri);
+ SourceUtil.copy(sourceHistory, (ModifiableSource) targetHistory, true);
+ }
}
} catch (Exception e) {
throw new RuntimeException(e);
@@ -190,6 +191,12 @@
this.manager.release(resolver);
}
if (sourceResolver != null) {
+ if (sourceHistory != null) {
+ sourceResolver.release(sourceHistory);
+ }
+ if (targetHistory != null) {
+ sourceResolver.release(targetHistory);
+ }
this.manager.release(sourceResolver);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org