Correct two equality checks on incomparable types (#27688)

This commit is contained in:
Robin Neatherway 2017-12-07 13:18:11 +00:00 committed by Christoph Büscher
parent ee21045697
commit 057efea893
2 changed files with 2 additions and 2 deletions

View File

@ -369,7 +369,7 @@ public class GeoShapeFieldMapper extends FieldMapper {
public void setStrategyName(String strategyName) { public void setStrategyName(String strategyName) {
checkIfFrozen(); checkIfFrozen();
this.strategyName = strategyName; this.strategyName = strategyName;
if (this.strategyName.equals(SpatialStrategy.TERM)) { if (this.strategyName.equals(SpatialStrategy.TERM.getStrategyName())) {
this.pointsOnly = true; this.pointsOnly = true;
} }
} }

View File

@ -768,7 +768,7 @@ public final class Definition {
painlessConstructor = new Method("<init>", ownerStruct, null, getTypeInternal("void"), painlessParametersTypes, painlessConstructor = new Method("<init>", ownerStruct, null, getTypeInternal("void"), painlessParametersTypes,
asmConstructor, javaConstructor.getModifiers(), javaHandle); asmConstructor, javaConstructor.getModifiers(), javaHandle);
ownerStruct.constructors.put(painlessMethodKey, painlessConstructor); ownerStruct.constructors.put(painlessMethodKey, painlessConstructor);
} else if (painlessConstructor.equals(painlessParametersTypes) == false){ } else if (painlessConstructor.arguments.equals(painlessParametersTypes) == false){
throw new IllegalArgumentException( throw new IllegalArgumentException(
"illegal duplicate constructors [" + painlessMethodKey + "] found within the struct [" + ownerStruct.name + "] " + "illegal duplicate constructors [" + painlessMethodKey + "] found within the struct [" + ownerStruct.name + "] " +
"with parameters " + painlessParametersTypes + " and " + painlessConstructor.arguments); "with parameters " + painlessParametersTypes + " and " + painlessConstructor.arguments);