diff --git a/core/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java index db40fb228bc..68d6ac66678 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java @@ -369,7 +369,7 @@ public class GeoShapeFieldMapper extends FieldMapper { public void setStrategyName(String strategyName) { checkIfFrozen(); this.strategyName = strategyName; - if (this.strategyName.equals(SpatialStrategy.TERM)) { + if (this.strategyName.equals(SpatialStrategy.TERM.getStrategyName())) { this.pointsOnly = true; } } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java index e5bfb82c731..df56c599f03 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java @@ -768,7 +768,7 @@ public final class Definition { painlessConstructor = new Method("", ownerStruct, null, getTypeInternal("void"), painlessParametersTypes, asmConstructor, javaConstructor.getModifiers(), javaHandle); ownerStruct.constructors.put(painlessMethodKey, painlessConstructor); - } else if (painlessConstructor.equals(painlessParametersTypes) == false){ + } else if (painlessConstructor.arguments.equals(painlessParametersTypes) == false){ throw new IllegalArgumentException( "illegal duplicate constructors [" + painlessMethodKey + "] found within the struct [" + ownerStruct.name + "] " + "with parameters " + painlessParametersTypes + " and " + painlessConstructor.arguments);