summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2013-05-08 23:52:52 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2013-05-10 21:37:51 +0200
commita62770a3dda7ac4a0fa7877e1cd42db3a99a8ecc (patch)
tree240ae09ee6cec22506528b763ace5cad183324c3 /org.eclipse.jgit
parent4800ac50f929b3673331ddf45ec07d8415fce86f (diff)
downloadjgit-a62770a3dda7ac4a0fa7877e1cd42db3a99a8ecc.tar.gz
jgit-a62770a3dda7ac4a0fa7877e1cd42db3a99a8ecc.zip
Fix the parameters to an exception
A parenthesis was in the wrong place passing arguments to the wrong format call. Also fix formatting of enclosing switch statement. Change-Id: I4cb9642f08b58c39033c3a81dab4bd56bebf4fd2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java38
1 files changed, 18 insertions, 20 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
index ccf35e8968..75307decb1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
@@ -615,26 +615,25 @@ public class GC {
while (treeWalk.next()) {
ObjectId objectId = treeWalk.getObjectId(0);
- switch (treeWalk.getRawMode(0) & FileMode.TYPE_MASK) {
- case FileMode.TYPE_MISSING:
- case FileMode.TYPE_GITLINK:
- continue;
- case FileMode.TYPE_TREE:
- case FileMode.TYPE_FILE:
- case FileMode.TYPE_SYMLINK:
- ret.add(objectId);
- continue;
- default:
+ switch (treeWalk.getRawMode(0) & FileMode.TYPE_MASK) {
+ case FileMode.TYPE_MISSING:
+ case FileMode.TYPE_GITLINK:
+ continue;
+ case FileMode.TYPE_TREE:
+ case FileMode.TYPE_FILE:
+ case FileMode.TYPE_SYMLINK:
+ ret.add(objectId);
+ continue;
+ default:
throw new IOException(MessageFormat.format(
- JGitText.get().corruptObjectInvalidMode3, String
- .format("%o", Integer.valueOf(treeWalk //$NON-NLS-1$
- .getRawMode(0)),
- (objectId == null) ? "null" //$NON-NLS-1$
- : objectId.name(), treeWalk
- .getPathString(), repo
- .getIndexFile())));
- }
- }
+ JGitText.get().corruptObjectInvalidMode3,
+ String.format("%o", //$NON-NLS-1$
+ Integer.valueOf(treeWalk.getRawMode(0))),
+ (objectId == null) ? "null" : objectId.name(), //$NON-NLS-1$
+ treeWalk.getPathString(), //
+ repo.getIndexFile()));
+ }
+ }
return ret;
} finally {
if (revWalk != null)
@@ -703,7 +702,6 @@ public class GC {
}
// write the packindex
- @SuppressWarnings("resource")
FileChannel idxChannel = new FileOutputStream(tmpIdx).getChannel();
OutputStream idxStream = Channels.newOutputStream(idxChannel);
try {