mirror of https://github.com/apache/lucene.git
SOLR-11907: Change error message if ConvexHull2D is not provided as the first parameter
This commit is contained in:
parent
3fc58f4a98
commit
3ece536d81
|
@ -34,7 +34,7 @@ public class GetAreaEvaluator extends RecursiveObjectEvaluator implements OneVal
|
|||
@Override
|
||||
public Object doWork(Object value) throws IOException {
|
||||
if(!(value instanceof ConvexHull2D)){
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a clustering result",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a ConvexHull2D",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
} else {
|
||||
ConvexHull2D convexHull2D = (ConvexHull2D)value;
|
||||
return convexHull2D.createRegion().getSize();
|
||||
|
|
|
@ -37,7 +37,7 @@ public class GetBaryCenterEvaluator extends RecursiveObjectEvaluator implements
|
|||
@Override
|
||||
public Object doWork(Object value) throws IOException {
|
||||
if(!(value instanceof ConvexHull2D)){
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a clustering result",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a ConvexHull2D",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
} else {
|
||||
ConvexHull2D convexHull2D = (ConvexHull2D)value;
|
||||
Vector2D vector2D = (Vector2D)convexHull2D.createRegion().getBarycenter();
|
||||
|
|
|
@ -34,7 +34,7 @@ public class GetBoundarySizeEvaluator extends RecursiveObjectEvaluator implement
|
|||
@Override
|
||||
public Object doWork(Object value) throws IOException {
|
||||
if(!(value instanceof ConvexHull2D)){
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a clustering result",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a ConvexHull2D",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
} else {
|
||||
ConvexHull2D convexHull2D = (ConvexHull2D)value;
|
||||
return convexHull2D.createRegion().getBoundarySize();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class GetVerticesEvaluator extends RecursiveObjectEvaluator implements On
|
|||
@Override
|
||||
public Object doWork(Object value) throws IOException {
|
||||
if(!(value instanceof ConvexHull2D)){
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a clustering result",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
throw new IOException(String.format(Locale.ROOT,"Invalid expression %s - found type %s for value, expecting a ConvexHull2D",toExpression(constructingFactory), value.getClass().getSimpleName()));
|
||||
} else {
|
||||
ConvexHull2D convexHull2D = (ConvexHull2D)value;
|
||||
Vector2D[] vectors = convexHull2D.getVertices();
|
||||
|
|
Loading…
Reference in New Issue