LUCENE-3538: removewarnings

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1189205 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-10-26 13:33:02 +00:00
parent 7b1175c602
commit 8160232d04

View File

@ -17,7 +17,7 @@
package org.apache.lucene.util.mutable; package org.apache.lucene.util.mutable;
/** @lucene.internal */ /** @lucene.internal */
public abstract class MutableValue implements Comparable { public abstract class MutableValue implements Comparable<MutableValue> {
public boolean exists = true; public boolean exists = true;
public abstract void copy(MutableValue source); public abstract void copy(MutableValue source);
@ -30,9 +30,9 @@ public abstract class MutableValue implements Comparable {
return exists; return exists;
} }
public int compareTo(Object other) { public int compareTo(MutableValue other) {
Class c1 = this.getClass(); Class<? extends MutableValue> c1 = this.getClass();
Class c2 = other.getClass(); Class<? extends MutableValue> c2 = other.getClass();
if (c1 != c2) { if (c1 != c2) {
int c = c1.hashCode() - c2.hashCode(); int c = c1.hashCode() - c2.hashCode();
if (c == 0) { if (c == 0) {
@ -45,9 +45,7 @@ public abstract class MutableValue implements Comparable {
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
Class c1 = this.getClass(); return (getClass() == other.getClass()) && this.equalsSameType(other);
Class c2 = other.getClass();
return (c1 == c2) && this.equalsSameType(other);
} }
@Override @Override