Skip to content

Commit 22b58d5

Browse files
committed
Fixed minor bugs
1 parent 48e4cfb commit 22b58d5

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

commons-math4-genetics/src/main/java/org/apache/commons/math4/genetics/chromosome/AbstractChromosome.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public int compareTo(final Chromosome<P> another) {
123123
* @param another chromosome to compare
124124
* @return true if <code>another</code> is equivalent to this chromosome
125125
*/
126-
protected boolean isSame(final AbstractChromosome<P> another) {
126+
public boolean isSame(final AbstractChromosome<P> another) {
127127
final P decodedChromosome = decode();
128128
final P otherDecodedChromosome = another.decode();
129129
return decodedChromosome.equals(otherDecodedChromosome);
@@ -141,22 +141,4 @@ public int hashCode() {
141141
return Objects.hash(decode());
142142
}
143143

144-
/** {@inheritDoc} */
145-
@SuppressWarnings("unchecked")
146-
@Override
147-
public boolean equals(Object obj) {
148-
if (this == obj) {
149-
return true;
150-
}
151-
if (obj == null) {
152-
return false;
153-
}
154-
if (getClass() != obj.getClass()) {
155-
return false;
156-
}
157-
final AbstractChromosome<P> other = (AbstractChromosome<P>) obj;
158-
159-
return isSame(other);
160-
}
161-
162144
}

0 commit comments

Comments
 (0)