Skip to content
Snippets Groups Projects
Commit c6edbe62 authored by langella's avatar langella
Browse files

hashcode equality is double checked to avoid collision problems

git-svn-id: https://subversion.renater.fr/xtandempipeline/trunk@112 b8ef2a07-7df7-436f-90b9-41648038564b
parent 281d91c8
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ xtandempipeline (3.1.2-1) natty; urgency=low
* Work In Progress
* ODS export
* Didier Chevret has found a bug (fixed in this version) : error writing MS sample name in project file
* HashCode collision problem on huge data file fixed for HashPeptide
-- Olivier Langella <Olivier.Langella@moulon.inra.fr> Sun, 8 May 2011 9:18:51 +0200
......
......@@ -19,12 +19,25 @@ public class HashPeptide extends HashKey4Groups {
+ sequence).hashCode();
}
@Override
public boolean equals(Object toCompare) {
if (this.hashCode() == toCompare.hashCode()) {
//very good idea Benoit !
HashPeptide toComparePeptide = (HashPeptide) toCompare;
if ((this.hashSampleScan == toComparePeptide.hashSampleScan)
&& (this.sequence == toComparePeptide.sequence)) {
return true;
}
}
return false;
}
@Override
public String toString() {
return hashSampleScan.toString()+" "+sequence;
return hashSampleScan.toString() + " " + sequence;
}
@Override
public int hashCode() {
return this.hascode;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment