From ce7ac03c2f582eae9e7d250fef0e1685c5c3ab22 Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Tue, 24 Apr 2018 13:05:16 -0700 Subject: [PATCH] Remove unused code and link to deprecated code Eclipse reports these as errors, so remove them. Change-Id: Ic53d8003f9faef38fe776af5a73794e7bb1dfc49 Signed-off-by: Jonathan Tan --- .../jgit/transport/UploadPackTest.java | 21 +------------------ .../org/eclipse/jgit/api/NameRevCommand.java | 3 +-- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java index 9a50fb7ce..e62d84ec5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java @@ -334,22 +334,6 @@ public UploadPack create(Object req, Repository db) } } - private static ByteArrayInputStream send(String... lines) throws Exception { - ByteArrayOutputStream os = new ByteArrayOutputStream(); - PacketLineOut pckOut = new PacketLineOut(os); - for (String line : lines) { - if (line == PacketLineIn.END) { - pckOut.end(); - } else if (line == PacketLineIn.DELIM) { - pckOut.writeDelim(); - } else { - pckOut.writeString(line); - } - } - byte[] a = os.toByteArray(); - return new ByteArrayInputStream(a); - } - /* * Invokes UploadPack with protocol v2 and sends it the given lines. * Returns UploadPack's output stream, not including the capability @@ -534,9 +518,6 @@ public void testV2LsRefsRefPrefixNoSlash() throws Exception { * into the client repository. */ private void parsePack(ByteArrayInputStream recvStream) throws Exception { - SideBandInputStream sb = new SideBandInputStream( - recvStream, NullProgressMonitor.INSTANCE, - new StringWriter(), NullOutputStream.INSTANCE); parsePack(recvStream, NullProgressMonitor.INSTANCE); } @@ -826,7 +807,7 @@ public void testV2FetchNoProgress() throws Exception { private static class RejectAllRefFilter implements RefFilter { @Override public Map filter(Map refs) { - return new HashMap(); + return new HashMap<>(); } }; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java index a9d9759a7..d6aafa3a1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java @@ -251,8 +251,7 @@ public NameRevCommand add(Iterable ids) * prefix added by {@link #addPrefix(String)}. * * @param prefix - * prefix to add; see - * {@link org.eclipse.jgit.lib.RefDatabase#getRefs(String)} + * prefix to add; the prefix must end with a slash * @return {@code this} */ public NameRevCommand addPrefix(String prefix) {