diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2009-12-28 15:55:49 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2009-12-28 15:58:37 -0800 |
commit | 1ec393e744cd16956cd800c9a56fcae19e150241 (patch) | |
tree | a4a1f34838e5d9e01df2ee4fd5f020d55ba06b5e /org.eclipse.jgit/src/org/eclipse/jgit/transport | |
parent | db9f8126db23ba90be62777f26a692c7adbb10d9 (diff) | |
download | jgit-1ec393e744cd16956cd800c9a56fcae19e150241.tar.gz jgit-1ec393e744cd16956cd800c9a56fcae19e150241.zip |
Use Constants.OBJECT_ID_STRING_LENGTH instead of LEN * 2
A few locations were doing OBJECT_ID_LENGTH * 2 on their own, as
the old STR_LEN constant wasn't visible. Replace them with the
new public constant OBJECT_ID_STRING_LENGTH.
Change-Id: Id39bddb52de8c65bb097de042e9d4ed99598201f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport')
4 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java index 92d07e1283..db1312ca30 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java @@ -179,7 +179,7 @@ public class BundleWriter { w.write(TransportBundle.V2_BUNDLE_SIGNATURE); w.write('\n'); - final char[] tmp = new char[Constants.OBJECT_ID_LENGTH * 2]; + final char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH]; for (final RevCommit a : assume) { w.write('-'); a.copyTo(tmp, w); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java index 6aa64cc46a..d87395c1cd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java @@ -882,7 +882,7 @@ public class ReceivePack { case REJECTED_MISSING_OBJECT: if (cmd.getMessage() == null) r.append("missing object(s)"); - else if (cmd.getMessage().length() == 2 * Constants.OBJECT_ID_LENGTH) + else if (cmd.getMessage().length() == Constants.OBJECT_ID_STRING_LENGTH) r.append("object " + cmd.getMessage() + " missing"); else r.append(cmd.getMessage()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java index dfbd891b0b..6a6053d941 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java @@ -70,7 +70,7 @@ class RefAdvertiser { private final StringBuilder tmpLine = new StringBuilder(100); - private final char[] tmpId = new char[2 * Constants.OBJECT_ID_LENGTH]; + private final char[] tmpId = new char[Constants.OBJECT_ID_STRING_LENGTH]; private final Set<String> capablities = new LinkedHashSet<String>(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java index de1c7de010..6a010fb4e5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java @@ -308,7 +308,7 @@ abstract class WalkRemoteObjectDatabase { void writeRef(final String name, final ObjectId value) throws IOException { final ByteArrayOutputStream b; - b = new ByteArrayOutputStream(Constants.OBJECT_ID_LENGTH * 2 + 1); + b = new ByteArrayOutputStream(Constants.OBJECT_ID_STRING_LENGTH + 1); value.copyTo(b); b.write('\n'); |