summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2012-03-12 10:16:42 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2012-03-12 10:16:42 -0400
commit0a69f05647b05b89c969a7366bee541c0e985af3 (patch)
treed6113d20bf5094b5f794f91023bf9ba84c1c0c4a
parent95ceb24866c02a49ee9e0dcf5d2617879e98527f (diff)
parent01ee87201f75cfd6de9e3f755c44f076f09059e7 (diff)
downloadjgit-0a69f05647b05b89c969a7366bee541c0e985af3.tar.gz
jgit-0a69f05647b05b89c969a7366bee541c0e985af3.zip
Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47e
* changes: cleanup: Silence an unused-parameter warning cleanup: Get rid of some unused-warnings cleanup: Remove unused parameter in ConsoleCredentialsProvider cleanup: Drop unused parameter on DhtPackParser cleanup: Remove unneeded parameter to private method in RefUpdateTest cleanup: Remove unnecessary @SuppressWarnings
-rw-r--r--org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java16
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java2
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java4
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java2
-rw-r--r--org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtPackParser.java8
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsRepositoryBuilder.java1
10 files changed, 24 insertions, 30 deletions
diff --git a/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java b/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
index f8f8ff9bcf..972ce44a4d 100644
--- a/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
+++ b/org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
@@ -99,16 +99,16 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
CredentialItem item = items[i];
if (item instanceof CredentialItem.StringType)
- ok = get(uri, (CredentialItem.StringType) item);
+ ok = get((CredentialItem.StringType) item);
else if (item instanceof CredentialItem.CharArrayType)
- ok = get(uri, (CredentialItem.CharArrayType) item);
+ ok = get((CredentialItem.CharArrayType) item);
else if (item instanceof CredentialItem.YesNoType)
- ok = get(uri, (CredentialItem.YesNoType) item);
+ ok = get((CredentialItem.YesNoType) item);
else if (item instanceof CredentialItem.InformationalMessage)
- ok = get(uri, (CredentialItem.InformationalMessage) item);
+ ok = get((CredentialItem.InformationalMessage) item);
else
throw new UnsupportedCredentialItem(uri, item.getPromptText());
@@ -116,7 +116,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
return ok;
}
- private boolean get(URIish uri, CredentialItem.StringType item) {
+ private boolean get(CredentialItem.StringType item) {
if (item.isValueSecure()) {
char[] v = cons.readPassword("%s: ", item.getPromptText());
if (v != null) {
@@ -136,7 +136,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
}
}
- private boolean get(URIish uri, CredentialItem.CharArrayType item) {
+ private boolean get(CredentialItem.CharArrayType item) {
if (item.isValueSecure()) {
char[] v = cons.readPassword("%s: ", item.getPromptText());
if (v != null) {
@@ -156,13 +156,13 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
}
}
- private boolean get(URIish uri, CredentialItem.InformationalMessage item) {
+ private boolean get(CredentialItem.InformationalMessage item) {
cons.printf("%s\n", item.getPromptText());
cons.flush();
return true;
}
- private boolean get(URIish uri, CredentialItem.YesNoType item) {
+ private boolean get(CredentialItem.YesNoType item) {
String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(),
ConsoleText.get().answerYes, ConsoleText.get().answerNo);
if (r != null) {
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
index ef3dc2cc73..11c3de39e4 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
@@ -138,7 +138,6 @@ public class GitServlet extends MetaServlet {
* the factory to construct and configure an {@link UploadPack}
* session when a fetch or clone is requested by a client.
*/
- @SuppressWarnings("unchecked")
public void setUploadPackFactory(UploadPackFactory<HttpServletRequest> f) {
gitFilter.setUploadPackFactory(f);
}
@@ -158,7 +157,6 @@ public class GitServlet extends MetaServlet {
* the factory to construct and configure a {@link ReceivePack}
* session when a push is requested by a client.
*/
- @SuppressWarnings("unchecked")
public void setReceivePackFactory(ReceivePackFactory<HttpServletRequest> f) {
gitFilter.setReceivePackFactory(f);
}
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
index 0accfc8b65..ba7ee9782b 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
@@ -184,6 +184,7 @@ public class RecordingLogger implements Logger {
// Ignore (not relevant to test failures)
}
+ @SuppressWarnings("unused")
public void ignore(Throwable arg0) {
// Ignore (not relevant to test failures)
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
index f100390e4e..beb6e31643 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
@@ -65,7 +65,7 @@ class Fetch extends AbstractFetchCommand {
private Boolean fsck;
@Option(name = "--no-fsck")
- void nofsck(final boolean ignored) {
+ void nofsck(@SuppressWarnings("unused") final boolean ignored) {
fsck = Boolean.FALSE;
}
@@ -79,7 +79,7 @@ class Fetch extends AbstractFetchCommand {
private Boolean thin;
@Option(name = "--no-thin")
- void nothin(final boolean ignored) {
+ void nothin(@SuppressWarnings("unused") final boolean ignored) {
thin = Boolean.FALSE;
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
index 83f1ee1779..677e7332c3 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
@@ -89,7 +89,7 @@ class Push extends TextBuiltin {
private boolean thin = Transport.DEFAULT_PUSH_THIN;
@Option(name = "--no-thin")
- void nothin(final boolean ignored) {
+ void nothin(@SuppressWarnings("unused") final boolean ignored) {
thin = false;
}
diff --git a/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtPackParser.java b/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtPackParser.java
index fdc143621c..a3972474e0 100644
--- a/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtPackParser.java
+++ b/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtPackParser.java
@@ -1016,11 +1016,11 @@ public class DhtPackParser extends PackParser {
break;
case OBJ_TREE:
- onTree(info, data);
+ onTree(data);
break;
case OBJ_TAG:
- onTag(info, data);
+ onTag(data);
break;
}
}
@@ -1045,7 +1045,7 @@ public class DhtPackParser extends PackParser {
}
}
- private void onTree(DhtInfo obj, byte[] data) {
+ private void onTree(byte[] data) {
if (isSaveAsCachedPack()) {
treeParser.reset(data);
while (!treeParser.eof()) {
@@ -1056,7 +1056,7 @@ public class DhtPackParser extends PackParser {
}
}
- private void onTag(DhtInfo obj, byte[] data) {
+ private void onTag(byte[] data) {
if (isSaveAsCachedPack()) {
idBuffer.fromString(data, 7); // "object $sha1"
lookupByName(idBuffer).setReferenced();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java
index 780fde3c61..cbdf23641e 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java
@@ -616,7 +616,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
ObjectId oldHead = db.resolve(Constants.HEAD);
assertFalse("precondition for this test, branch b != HEAD", rb
.equals(oldHead));
- writeReflog(db, rb, rb, "Just a message", "refs/heads/b");
+ writeReflog(db, rb, "Just a message", "refs/heads/b");
assertTrue("log on old branch", new File(db.getDirectory(),
"logs/refs/heads/b").exists());
RefRename renameRef = db.renameRef("refs/heads/b",
@@ -640,7 +640,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
writeSymref(Constants.HEAD, "refs/heads/b");
ObjectId oldHead = db.resolve(Constants.HEAD);
assertTrue("internal test condition, b == HEAD", rb.equals(oldHead));
- writeReflog(db, rb, rb, "Just a message", "refs/heads/b");
+ writeReflog(db, rb, "Just a message", "refs/heads/b");
assertTrue("log on old branch", new File(db.getDirectory(),
"logs/refs/heads/b").exists());
RefRename renameRef = db.renameRef("refs/heads/b",
@@ -669,7 +669,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
Result update = updateRef.update();
assertEquals("internal check new ref is loose", Result.FORCED, update);
assertEquals(Ref.Storage.LOOSE, db.getRef("refs/heads/b").getStorage());
- writeReflog(db, rb, rb, "Just a message", "refs/heads/b");
+ writeReflog(db, rb, "Just a message", "refs/heads/b");
assertTrue("log on old branch", new File(db.getDirectory(),
"logs/refs/heads/b").exists());
RefRename renameRef = db.renameRef("refs/heads/b",
@@ -699,8 +699,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
writeSymref(Constants.HEAD, headPointsTo);
ObjectId oldfromId = db.resolve(fromName);
ObjectId oldHeadId = db.resolve(Constants.HEAD);
- writeReflog(db, oldfromId, oldfromId, "Just a message",
- fromName);
+ writeReflog(db, oldfromId, "Just a message", fromName);
List<org.eclipse.jgit.storage.file.ReflogEntry> oldFromLog = db
.getReflogReader(fromName).getReverseEntries();
List<org.eclipse.jgit.storage.file.ReflogEntry> oldHeadLog = oldHeadId != null ? db
@@ -806,7 +805,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
assertEquals(Result.FAST_FORWARD, updateRef.update());
ObjectId oldHead = db.resolve(Constants.HEAD);
assertTrue(rb.equals(oldHead)); // assumption for this test
- writeReflog(db, rb, rb, "Just a message", "refs/heads/a");
+ writeReflog(db, rb, "Just a message", "refs/heads/a");
assertTrue("internal check, we have a log", new File(db.getDirectory(),
"logs/refs/heads/a").exists());
@@ -840,8 +839,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
assertEquals(Result.FORCED, updateRef.update());
ObjectId oldHead = db.resolve(Constants.HEAD);
assertTrue(rb.equals(oldHead)); // assumption for this test
- writeReflog(db, rb, rb, "Just a message",
- "refs/heads/prefix/a");
+ writeReflog(db, rb, "Just a message", "refs/heads/prefix/a");
assertTrue("internal check, we have a log", new File(db.getDirectory(),
"logs/refs/heads/prefix/a").exists());
@@ -864,8 +862,8 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
"HEAD").getReverseEntries().get(0).getComment());
}
- private void writeReflog(Repository db, ObjectId oldId, ObjectId newId,
- String msg, String refName) throws IOException {
+ private void writeReflog(Repository db, ObjectId newId, String msg,
+ String refName) throws IOException {
RefDirectory refs = (RefDirectory) db.getRefDatabase();
RefDirectoryUpdate update = refs.newUpdate(refName, true);
update.setNewObjectId(newId);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java
index ba704e5104..18b50e04ed 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsBlockCache.java
@@ -524,7 +524,6 @@ public final class DfsBlockCache {
return true;
}
- @SuppressWarnings("unchecked")
private <T> T scan(HashEntry n, DfsPackKey pack, long position) {
Ref<T> r = scanRef(n, pack, position);
return r != null ? r.get() : null;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java
index 621480bc55..0ba846a2a5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java
@@ -541,7 +541,6 @@ final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
}
}
- @SuppressWarnings("unchecked")
public Collection<CachedPack> getCachedPacks() throws IOException {
DfsPackFile[] packList = db.getPacks();
List<CachedPack> cached = new ArrayList<CachedPack>(packList.length);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsRepositoryBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsRepositoryBuilder.java
index a41779f4d0..5e526b4495 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsRepositoryBuilder.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsRepositoryBuilder.java
@@ -120,7 +120,6 @@ public abstract class DfsRepositoryBuilder<B extends DfsRepositoryBuilder, R ext
* the repository could not be accessed to configure the rest of
* the builder's parameters.
*/
- @SuppressWarnings("unchecked")
@Override
public abstract R build() throws IOException;