diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java
index 13c54201c61de7bccd83ea54913d0201af651e35..9d9174111bb63691e4bde04f44b3700d09f6e84d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java
@@ -73,7 +73,7 @@ public final class AbbreviatedObjectId {
 	 */
 	public static final AbbreviatedObjectId fromString(final byte[] buf,
 			final int offset, final int end) {
-		if (end - offset > AnyObjectId.STR_LEN)
+		if (end - offset > Constants.OBJECT_ID_STRING_LENGTH)
 			throw new IllegalArgumentException("Invalid id");
 		return fromHexString(buf, offset, end);
 	}
@@ -86,7 +86,7 @@ public static final AbbreviatedObjectId fromString(final byte[] buf,
 	 * @return the converted object id.
 	 */
 	public static final AbbreviatedObjectId fromString(final String str) {
-		if (str.length() > AnyObjectId.STR_LEN)
+		if (str.length() > Constants.OBJECT_ID_STRING_LENGTH)
 			throw new IllegalArgumentException("Invalid id: " + str);
 		final byte[] b = Constants.encodeASCII(str);
 		return fromHexString(b, 0, b.length);
@@ -167,7 +167,7 @@ public int length() {
 
 	/** @return true if this ObjectId is actually a complete id. */
 	public boolean isComplete() {
-		return length() == AnyObjectId.RAW_LEN * 2;
+		return length() == Constants.OBJECT_ID_STRING_LENGTH;
 	}
 
 	/** @return a complete ObjectId; null if {@link #isComplete()} is false */
@@ -231,7 +231,7 @@ public boolean equals(final Object o) {
 	 * @return string form of the abbreviation, in lower case hexadecimal.
 	 */
 	public final String name() {
-		final char[] b = new char[AnyObjectId.STR_LEN];
+		final char[] b = new char[Constants.OBJECT_ID_STRING_LENGTH];
 
 		AnyObjectId.formatHexChar(b, 0, w1);
 		if (nibbles <= 8)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
index efea0ec2221b85fe8f4433d82f4e586e5065a1e3..d4d53574b3b21d15baa3d1e53f7f7c4d3f5113d1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
@@ -58,16 +58,6 @@
  * represent a different object name.
  */
 public abstract class AnyObjectId implements Comparable {
-	static final int RAW_LEN = Constants.OBJECT_ID_LENGTH;
-
-	static final int STR_LEN = RAW_LEN * 2;
-
-	static {
-		if (RAW_LEN != 20)
-			throw new LinkageError("ObjectId expects"
-					+ " Constants.OBJECT_ID_LENGTH = 20; it is " + RAW_LEN
-					+ ".");
-	}
 
 	/**
 	 * Compare to object identifier byte sequences for equality.
@@ -312,7 +302,7 @@ public void copyTo(final OutputStream w) throws IOException {
 	}
 
 	private byte[] toHexByteArray() {
-		final byte[] dst = new byte[STR_LEN];
+		final byte[] dst = new byte[Constants.OBJECT_ID_STRING_LENGTH];
 		formatHexByte(dst, 0, w1);
 		formatHexByte(dst, 8, w2);
 		formatHexByte(dst, 16, w3);
@@ -360,7 +350,7 @@ public void copyTo(final Writer w) throws IOException {
 	 */
 	public void copyTo(final char[] tmp, final Writer w) throws IOException {
 		toHexCharArray(tmp);
-		w.write(tmp, 0, STR_LEN);
+		w.write(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH);
 	}
 
 	/**
@@ -375,11 +365,11 @@ public void copyTo(final char[] tmp, final Writer w) throws IOException {
 	 */
 	public void copyTo(final char[] tmp, final StringBuilder w) {
 		toHexCharArray(tmp);
-		w.append(tmp, 0, STR_LEN);
+		w.append(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH);
 	}
 
 	private char[] toHexCharArray() {
-		final char[] dst = new char[STR_LEN];
+		final char[] dst = new char[Constants.OBJECT_ID_STRING_LENGTH];
 		toHexCharArray(dst);
 		return dst;
 	}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
index de1315957b0511d5bb4841d56e5d2cd47f3718ee..c1d78be5afdc97a5f2a3f0a1e60e2d98c939c5c2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
@@ -58,9 +58,22 @@ public final class Constants {
 	/** Hash function used natively by Git for all objects. */
 	private static final String HASH_FUNCTION = "SHA-1";
 
-	/** Length of an object hash. */
+	/**
+	 * A Git object hash is 160 bits, i.e. 20 bytes.
+	 * <p>
+	 * Changing this assumption is not going to be as easy as changing this
+	 * declaration.
+	 */
 	public static final int OBJECT_ID_LENGTH = 20;
 
+	/**
+	 * A Git object can be expressed as a 40 character string of hexadecimal
+	 * digits.
+	 *
+	 * @see #OBJECT_ID_LENGTH
+	 */
+	public static final int OBJECT_ID_STRING_LENGTH = OBJECT_ID_LENGTH * 2;
+
 	/** Special name for the "HEAD" symbolic-ref. */
 	public static final String HEAD = "HEAD";
 
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java
index c8df1e2ce6187b8a9a7bdd2efb643aa07c82247c..a6680d055153aadf46c2e897f76e3c8c2488a43f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java
@@ -1,8 +1,7 @@
 /*
  * Copyright (C) 2008-2009, Google Inc.
- * Copyright (C) 2009, Jonas Fonseca <fonseca@diku.dk>
  * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
- * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2007-2009, Robin Rosenberg <robin.rosenberg@dewire.com>
  * Copyright (C) 2006-2008, Shawn O. Pearce <spearce@spearce.org>
  * and other copyright owners as documented in the project's IP log.
  *
@@ -162,7 +161,7 @@ public void fromString(final byte[] buf, final int offset) {
 	 *            the string to read from. Must be 40 characters long.
 	 */
 	public void fromString(final String str) {
-		if (str.length() != STR_LEN)
+		if (str.length() != Constants.OBJECT_ID_STRING_LENGTH)
 			throw new IllegalArgumentException("Invalid id: " + str);
 		fromHexString(Constants.encodeASCII(str), 0);
 	}
@@ -175,7 +174,8 @@ private void fromHexString(final byte[] bs, int p) {
 			w4 = RawParseUtils.parseHexInt32(bs, p + 24);
 			w5 = RawParseUtils.parseHexInt32(bs, p + 32);
 		} catch (ArrayIndexOutOfBoundsException e1) {
-			throw new InvalidObjectIdException(bs, p, STR_LEN);
+			throw new InvalidObjectIdException(bs, p,
+					Constants.OBJECT_ID_STRING_LENGTH);
 		}
 	}
 
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
index 9cf1643db5b1c8b5f813924ea665fb8b497fe379..82a8c382577731046bdf15c80a9ff660c2cc302f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
@@ -130,7 +130,7 @@ public void check(final int objType, final byte[] raw)
 	private int id(final byte[] raw, final int ptr) {
 		try {
 			tempId.fromString(raw, ptr);
-			return ptr + AnyObjectId.STR_LEN;
+			return ptr + Constants.OBJECT_ID_STRING_LENGTH;
 		} catch (IllegalArgumentException e) {
 			return -1;
 		}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
index 3a4e3a891ba6354c9e85ae6a10626bfb65115c9f..fc43d19537f09ac2e1a0eced3873e175044ab67c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
@@ -80,10 +80,10 @@ public static final ObjectId zeroId() {
 	 * @return true if the string can converted into an ObjectId.
 	 */
 	public static final boolean isId(final String id) {
-		if (id.length() != STR_LEN)
+		if (id.length() != Constants.OBJECT_ID_STRING_LENGTH)
 			return false;
 		try {
-			for (int i = 0; i < STR_LEN; i++) {
+			for (int i = 0; i < Constants.OBJECT_ID_STRING_LENGTH; i++) {
 				RawParseUtils.parseHexInt4((byte) id.charAt(i));
 			}
 			return true;
@@ -221,7 +221,7 @@ public static final ObjectId fromString(final byte[] buf, final int offset) {
 	 * @return the converted object id.
 	 */
 	public static final ObjectId fromString(final String str) {
-		if (str.length() != STR_LEN)
+		if (str.length() != Constants.OBJECT_ID_STRING_LENGTH)
 			throw new IllegalArgumentException("Invalid id: " + str);
 		return fromHexString(Constants.encodeASCII(str), 0);
 	}
@@ -235,7 +235,8 @@ private static final ObjectId fromHexString(final byte[] bs, int p) {
 			final int e = RawParseUtils.parseHexInt32(bs, p + 32);
 			return new ObjectId(a, b, c, d, e);
 		} catch (ArrayIndexOutOfBoundsException e1) {
-			throw new InvalidObjectIdException(bs, p, STR_LEN);
+			throw new InvalidObjectIdException(bs, p,
+					Constants.OBJECT_ID_STRING_LENGTH);
 		}
 	}