]> source.dussan.org Git - jgit.git/commitdiff
Remove unused code and link to deprecated code 88/121688/3
authorJonathan Tan <jonathantanmy@google.com>
Tue, 24 Apr 2018 20:05:16 +0000 (13:05 -0700)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 24 Apr 2018 22:46:13 +0000 (00:46 +0200)
Eclipse reports these as errors, so remove them.

Change-Id: Ic53d8003f9faef38fe776af5a73794e7bb1dfc49
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java

index 9a50fb7cea53f3fb6b88a6e213761481d5ac0d0a..e62d84ec5d084f40db88e4f1faaab43594f818e3 100644 (file)
@@ -334,22 +334,6 @@ public class UploadPackTest {
                }
        }
 
-       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 class UploadPackTest {
         * 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 class UploadPackTest {
        private static class RejectAllRefFilter implements RefFilter {
                @Override
                public Map<String, Ref> filter(Map<String, Ref> refs) {
-                       return new HashMap<String, Ref>();
+                       return new HashMap<>();
                }
        };
 }
index a9d9759a7435b32c2f94ae02c871bfedebb5b07b..d6aafa3a12d433e6df09f7d653f86dba94eeeb49 100644 (file)
@@ -251,8 +251,7 @@ public class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
         * 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) {