Просмотр исходного кода

Make ObjectId.hashCode final too

Since equals() is now final and does not permit being overridden,
we should do the same thing with hashCode() to prevent different
subclasses from having different hashing behaviors.  This could
lead to the same mess that we had with different equals() behaviors.

Change-Id: I35a849b6efccee5fe74cc5788a3566a1516004b7
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.9.1
Shawn O. Pearce 13 лет назад
Родитель
Сommit
5adcd708e4
1 измененных файлов: 1 добавлений и 1 удалений
  1. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java Просмотреть файл

@@ -219,7 +219,7 @@ public abstract class AnyObjectId implements Comparable {
return abbr.prefixCompare(this) == 0;
}

public int hashCode() {
public final int hashCode() {
return w2;
}


Загрузка…
Отмена
Сохранить