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>
This commit is contained in:
parent
392f1e70a8
commit
292cfab10d
|
@ -219,7 +219,7 @@ public ObjectId call() throws GitAPIException {
|
||||||
FileUtils.delete(stashFile);
|
FileUtils.delete(stashFile);
|
||||||
if (!stashLockFile.renameTo(stashFile))
|
if (!stashLockFile.renameTo(stashFile))
|
||||||
throw new JGitInternalException(MessageFormat.format(
|
throw new JGitInternalException(MessageFormat.format(
|
||||||
JGitText.get().couldNotWriteFile,
|
JGitText.get().renameFileFailed,
|
||||||
stashLockFile.getPath(), stashFile.getPath()));
|
stashLockFile.getPath(), stashFile.getPath()));
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -1154,7 +1154,7 @@ public static void checkoutEntry(final Repository repo, File f,
|
||||||
FileUtils.rename(tmpFile, f);
|
FileUtils.rename(tmpFile, f);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IOException(MessageFormat.format(
|
throw new IOException(MessageFormat.format(
|
||||||
JGitText.get().couldNotWriteFile, tmpFile.getPath(),
|
JGitText.get().renameFileFailed, tmpFile.getPath(),
|
||||||
f.getPath()));
|
f.getPath()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue