diff --git a/common/source/java/ch/systemsx/cisd/common/exceptions/StopException.java b/common/source/java/ch/systemsx/cisd/common/exceptions/StopException.java index 77a93f826ad0a561ca25113707a83bab21a61cb8..8024ee680d196174800f26d6235913769434ef84 100644 --- a/common/source/java/ch/systemsx/cisd/common/exceptions/StopException.java +++ b/common/source/java/ch/systemsx/cisd/common/exceptions/StopException.java @@ -21,6 +21,7 @@ package ch.systemsx.cisd.common.exceptions; * <p> * This is usually triggered by interrupting the thread that the work package is processed in and * regularly checking with {@link #check()}. + * </p> * * @author Bernd Rinn */ diff --git a/common/source/java/ch/systemsx/cisd/common/process/FileRenamingCallable.java b/common/source/java/ch/systemsx/cisd/common/process/FileRenamingCallable.java index e5d935731f43a1de8f956272017cbe092f0a2867..a468aa7167f44e7cff290407d0d65ed171ea9bbb 100644 --- a/common/source/java/ch/systemsx/cisd/common/process/FileRenamingCallable.java +++ b/common/source/java/ch/systemsx/cisd/common/process/FileRenamingCallable.java @@ -59,19 +59,22 @@ public final class FileRenamingCallable implements Callable<Boolean> operationLog.error(String.format( "Path '%s' doesn't exist, so it can't be moved to '%s'.", sourceFile, destinationFile)); - // Nothing to do here. So exit the looping by returning true. - return true; + return false; } if (destinationFile.exists()) { operationLog.error(String.format("Destination path '%s' already exists.", destinationFile)); - // Nothing to do here. So exit the looping by returning true. - return true; + return false; } - operationLog.warn(String.format("Moving path '%s' to directory '%s' failed (attempt %d).", - sourceFile, destinationFile, ++failures)); final boolean renamed = sourceFile.renameTo(destinationFile); - return renamed ? true : null; + if (renamed == false) + { + operationLog.warn(String.format( + "Moving path '%s' to directory '%s' failed (attempt %d).", sourceFile, + destinationFile, ++failures)); + return null; + } + return true; } } \ No newline at end of file