Browse Source

Fix wrong Exception messages

In two places we threw an IOException and the message was built using
JGitText.couldNotWriteFile. We specified 2 parameters, but this pattern
expects only one parameter. In both places we tried to rename a file,
that's why we wanted two parameters (src and target) for the exception
text.

I changed it to use JGitText.renameFileFailed which accepts two
parameters and fits better.

Change-Id: Ib8c2cf78f2b26ca2b97754fe91fdb20b30392415
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-3.4
Christian Halstrick 11 years ago committed by Matthias Sohn
parent
commit
292cfab10d
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java
  2. 2
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java

2
org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java

@ -219,7 +219,7 @@ public class StashDropCommand extends GitCommand<ObjectId> {
FileUtils.delete(stashFile);
if (!stashLockFile.renameTo(stashFile))
throw new JGitInternalException(MessageFormat.format(
JGitText.get().couldNotWriteFile,
JGitText.get().renameFileFailed,
stashLockFile.getPath(), stashFile.getPath()));
}
} catch (IOException e) {

2
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java vendored

@ -1154,7 +1154,7 @@ public class DirCacheCheckout {
FileUtils.rename(tmpFile, f);
} catch (IOException e) {
throw new IOException(MessageFormat.format(
JGitText.get().couldNotWriteFile, tmpFile.getPath(),
JGitText.get().renameFileFailed, tmpFile.getPath(),
f.getPath()));
}
}

Loading…
Cancel
Save