]> source.dussan.org Git - jgit.git/commitdiff
Fix wrong Exception messages 22/26422/2
authorChristian Halstrick <christian.halstrick@sap.com>
Tue, 13 May 2014 07:17:25 +0000 (09:17 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 13 May 2014 22:52:06 +0000 (00:52 +0200)
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>
org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java

index e4431c37b13ce4d79a7b8b5e4fa22c75a1330c62..6cbcd0673593a5d686b0581ff1072ef1fbe368b5 100644 (file)
@@ -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) {
index 5275b4c8980d22c81bee7d36502cdd71b7cf9511..fdf8c052fe757a30a495b734966ffe9da10aed91 100644 (file)
@@ -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()));
                        }
                }