summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2014-05-13 09:17:25 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2014-05-14 00:52:06 +0200
commit292cfab10d76fd372f76c672e96e9d168f8d7abf (patch)
tree2596b390977d38a58a2fb94e570fcad3eea35566
parent392f1e70a8158e4f6721903c2c034cc22ce30228 (diff)
downloadjgit-292cfab10d76fd372f76c672e96e9d168f8d7abf.tar.gz
jgit-292cfab10d76fd372f76c672e96e9d168f8d7abf.zip
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java
index e4431c37b1..6cbcd06735 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java
+++ b/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) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index 5275b4c898..fdf8c052fe 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -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()));
}
}