mirror of https://github.com/apache/druid.git
Fix inconsistent equals and hashCode (#8381)
* Fix inconsistent equals and hashCode * Patch comments * Remove equals and hashCode from InsensitiveContainsSearchQuerySpec
This commit is contained in:
parent
ee4ebb496a
commit
de18840412
|
@ -72,5 +72,10 @@ public class GoogleBlob
|
|||
return Objects.equals(bucket, that.bucket) &&
|
||||
Objects.equals(path, that.path);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(bucket, path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.druid.server.lookup.cache.loading.LoadingCache;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@JsonTypeName("loadingLookup")
|
||||
|
@ -137,6 +138,11 @@ public class LoadingLookupFactory implements LookupExtractorFactory
|
|||
return reverseLoadingCache != null
|
||||
? reverseLoadingCache.equals(that.reverseLoadingCache)
|
||||
: that.reverseLoadingCache == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(dataFetcher, loadingCache, reverseLoadingCache);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.apache.druid.server.lookup.cache.polling.PollingCacheFactory;
|
|||
import org.joda.time.Period;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@JsonTypeName("pollingLookup")
|
||||
|
@ -155,6 +156,11 @@ public class PollingLookupFactory implements LookupExtractorFactory
|
|||
? (that.cacheFactory != null
|
||||
&& cacheFactory.getClass() == (that.cacheFactory).getClass())
|
||||
: that.cacheFactory == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(pollPeriod, dataFetcher, cacheFactory);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ import java.sql.Connection;
|
|||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class JdbcDataFetcher implements DataFetcher<String, String>
|
||||
{
|
||||
|
@ -183,6 +184,12 @@ public class JdbcDataFetcher implements DataFetcher<String, String>
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(connectorConfig, table, keyColumn, valueColumn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
|
|
@ -150,4 +150,10 @@ public class StandardDeviationPostAggregator implements PostAggregator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(name, fieldName, estimator, isVariancePop);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,6 +82,12 @@ public class IdentityExtractionFn implements ExtractionFn
|
|||
return o != null && o instanceof IdentityExtractionFn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final IdentityExtractionFn getInstance()
|
||||
{
|
||||
return INSTANCE;
|
||||
|
|
|
@ -87,6 +87,12 @@ public class StringComparators
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@ -269,6 +275,12 @@ public class StringComparators
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@ -314,10 +326,15 @@ public class StringComparators
|
|||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@ -410,10 +427,15 @@ public class StringComparators
|
|||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getCacheKey()
|
||||
{
|
||||
|
@ -461,6 +483,12 @@ public class StringComparators
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getCacheKey()
|
||||
{
|
||||
|
|
|
@ -41,16 +41,4 @@ public class InsensitiveContainsSearchQuerySpec extends ContainsSearchQuerySpec
|
|||
"value=" + getValue() +
|
||||
"}";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
return super.equals(o);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue