diff --git a/sql/src/main/java/io/cloudevents/sql/impl/ExceptionFactoryImpl.java b/sql/src/main/java/io/cloudevents/sql/impl/ExceptionFactoryImpl.java index 2117897f..0f6b892a 100644 --- a/sql/src/main/java/io/cloudevents/sql/impl/ExceptionFactoryImpl.java +++ b/sql/src/main/java/io/cloudevents/sql/impl/ExceptionFactoryImpl.java @@ -1,20 +1,16 @@ package io.cloudevents.sql.impl; import io.cloudevents.sql.EvaluationException; -import io.cloudevents.sql.ParseException; -import io.cloudevents.sql.Type; -import org.antlr.v4.runtime.RecognitionException; import org.antlr.v4.runtime.misc.Interval; -import org.antlr.v4.runtime.tree.ParseTree; /** * This class includes a list of static methods to create {@link io.cloudevents.sql.ParseException} and {@link io.cloudevents.sql.EvaluationException}. */ public class ExceptionFactoryImpl implements io.cloudevents.sql.ExceptionFactory { - private final boolean shouldFail; + private final boolean shouldThrow; - public ExceptionFactoryImpl(boolean shouldFail) { - this.shouldFail = shouldFail; + public ExceptionFactoryImpl(boolean shouldThrow) { + this.shouldThrow = shouldThrow; } public EvaluationException.EvaluationExceptionFactory invalidCastTarget(Class from, Class to) { @@ -27,7 +23,7 @@ public EvaluationException.EvaluationExceptionFactory invalidCastTarget(Class null ); - if (this.shouldFail) { + if (this.shouldThrow) { throw exception; } return exception; @@ -44,7 +40,7 @@ public EvaluationException.EvaluationExceptionFactory castError(Class from, C cause ); - if (this.shouldFail) { + if (this.shouldThrow) { throw exception; } return exception; @@ -60,7 +56,7 @@ public EvaluationException missingAttribute(Interval interval, String expression null ); - if (this.shouldFail) { + if (this.shouldThrow) { throw exception; } return exception; @@ -75,7 +71,7 @@ public EvaluationException cannotDispatchFunction(Interval interval, String expr cause ); - if (this.shouldFail) { + if (this.shouldThrow) { throw exception; } return exception; @@ -91,7 +87,7 @@ public EvaluationException.EvaluationExceptionFactory functionExecutionError(Str cause ); - if (this.shouldFail) { + if (this.shouldThrow) { throw exception; } return exception; @@ -112,7 +108,7 @@ public EvaluationException mathError(Interval interval, String expression, Strin null ); - if (this.shouldFail) { + if (this.shouldThrow) { throw exception; } return exception;