summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2009-10-06 11:16:31 +0200
committerChristian Halstrick <christian.halstrick@sap.com>2009-10-07 15:13:18 +0200
commit6549af4591e84dd872ce6a92f6ea638770bd9696 (patch)
treec92805f661e3af3bec8aebe7f72f635d4a5bc899 /org.eclipse.jgit.pgm/src
parenta3aa43ecb164d13679b9ee33fb8626c82dea7f8c (diff)
downloadjgit-6549af4591e84dd872ce6a92f6ea638770bd9696.tar.gz
jgit-6549af4591e84dd872ce6a92f6ea638770bd9696.zip
Fix some warnings regarding unnecessary imports and accessing static methods
My Galileo eclipse was complaining about unneeded import statements and how static methods have been accessed in Diff.java. There was also one method call which could be removed because he had no sideeffects and the return value was not used. I fixed this so that there are no warnings anymore. Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Change-Id: I48d7e01536aab1524140d72af574e3fd7149cd23
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java17
1 files changed, 4 insertions, 13 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
index 3b327efd7f..24bcdcc612 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>
* Copyright (C) 2009, Johannes E. Schindelin
* Copyright (C) 2009, Johannes Schindelin <johannes.schindelin@gmx.de>
* and other copyright owners as documented in the project's IP log.
@@ -46,29 +47,20 @@ package org.eclipse.jgit.pgm;
import java.io.IOException;
import java.io.PrintStream;
-
import java.util.ArrayList;
import java.util.List;
import org.kohsuke.args4j.Argument;
-import org.kohsuke.args4j.ExampleMode;
import org.kohsuke.args4j.Option;
import org.eclipse.jgit.diff.DiffFormatter;
import org.eclipse.jgit.diff.MyersDiff;
import org.eclipse.jgit.diff.RawText;
-
-import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.Ref;
-
-import org.eclipse.jgit.pgm.opt.CmdLineParser;
import org.eclipse.jgit.pgm.opt.PathTreeFilterHandler;
-
import org.eclipse.jgit.treewalk.AbstractTreeIterator;
import org.eclipse.jgit.treewalk.TreeWalk;
-
import org.eclipse.jgit.treewalk.filter.AndTreeFilter;
import org.eclipse.jgit.treewalk.filter.TreeFilter;
@@ -96,7 +88,6 @@ class Diff extends TextBuiltin {
walk.addTree(i);
walk.setFilter(AndTreeFilter.create(TreeFilter.ANY_DIFF, pathFilter));
- final int nTree = walk.getTreeCount();
while (walk.next())
outputDiff(System.out, walk.getPathString(),
walk.getObjectId(0), walk.getFileMode(0),
@@ -110,10 +101,10 @@ class Diff extends TextBuiltin {
out.println("diff --git " + name1 + " " + name2);
boolean isNew=false;
boolean isDelete=false;
- if (id1.equals(id1.zeroId())) {
+ if (id1.equals(ObjectId.zeroId())) {
out.println("new file mode " + mode2);
isNew=true;
- } else if (id2.equals(id2.zeroId())) {
+ } else if (id2.equals(ObjectId.zeroId())) {
out.println("deleted file mode " + mode1);
isDelete=true;
} else if (!mode1.equals(mode2)) {
@@ -132,7 +123,7 @@ class Diff extends TextBuiltin {
}
private RawText getRawText(ObjectId id) throws IOException {
- if (id.equals(id.zeroId()))
+ if (id.equals(ObjectId.zeroId()))
return new RawText(new byte[] { });
return new RawText(db.openBlob(id).getCachedBytes());
}