Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce2013-03-01 00:21:59 +0000
committerGerrit Code Review @ Eclipse.org2013-03-01 00:21:59 +0000
commit178d55c24d784bc07adbb0d78de8ba1919843e86 (patch)
tree0a645ebd55e90feb425a45a899edca3fe98bb470
parent4a317a1790ae0d7ca2febaf41ec326ae8a8839b7 (diff)
parent78606404de66a3c7c279dddf736f1a926d1d8d89 (diff)
downloadjgit-178d55c24d784bc07adbb0d78de8ba1919843e86.tar.gz
jgit-178d55c24d784bc07adbb0d78de8ba1919843e86.tar.xz
jgit-178d55c24d784bc07adbb0d78de8ba1919843e86.zip
Merge "Improve the documentation of the ByteArraySet used by PathFilterGroup"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java
index 5a35359821..91251e4d2d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java
@@ -53,6 +53,10 @@ import org.eclipse.jgit.util.RawParseUtils;
* {@link PathFilterGroup.Group}. Most methods assume the hash is already know
* and therefore requires the caller to supply it beforehand. The implementation
* is a loose derivative of ObjectIdSubclassMap.
+ * <p>
+ * The class is only intended for use by PathFilterGroup.
+ * <p>
+ * The arrays stored may not be changed after adding.
*/
class ByteArraySet {
@@ -87,11 +91,11 @@ class ByteArraySet {
return null;
}
- private static boolean equals(byte[] a, byte[] b, int length) {
- if (a.length != length || b.length < length)
+ private static boolean equals(byte[] storedObj, byte[] toFind, int length) {
+ if (storedObj.length != length || toFind.length < length)
return false;
for (int i = 0; i < length; ++i) {
- if (a[i] != b[i])
+ if (storedObj[i] != toFind[i])
return false;
}
return true;
@@ -125,7 +129,8 @@ class ByteArraySet {
* </pre>
*
* @param newValue
- * the array to store.
+ * the array to store by reference if the length is the same as
+ * the length parameter
* @param length
* The number of bytes in newValue that are used
* @param hash
@@ -246,6 +251,9 @@ class ByteArraySet {
return -1;
}
+ /**
+ * An incremental hash function.
+ */
static class Hasher {
private int hash;

Back to the top