Skip to content

Commit 09bc8ba

Browse files
committed
cleanup: shouldFail -> shouldThrow
Signed-off-by: Calum Murray <cmurray@redhat.com>
1 parent cfcff87 commit 09bc8ba

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

sql/src/main/java/io/cloudevents/sql/impl/ExceptionFactoryImpl.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
package io.cloudevents.sql.impl;
22

33
import io.cloudevents.sql.EvaluationException;
4-
import io.cloudevents.sql.ParseException;
5-
import io.cloudevents.sql.Type;
6-
import org.antlr.v4.runtime.RecognitionException;
74
import org.antlr.v4.runtime.misc.Interval;
8-
import org.antlr.v4.runtime.tree.ParseTree;
95

106
/**
117
* This class includes a list of static methods to create {@link io.cloudevents.sql.ParseException} and {@link io.cloudevents.sql.EvaluationException}.
128
*/
139
public class ExceptionFactoryImpl implements io.cloudevents.sql.ExceptionFactory {
14-
private final boolean shouldFail;
10+
private final boolean shouldThrow;
1511

16-
public ExceptionFactoryImpl(boolean shouldFail) {
17-
this.shouldFail = shouldFail;
12+
public ExceptionFactoryImpl(boolean shouldThrow) {
13+
this.shouldThrow = shouldThrow;
1814
}
1915

2016
public EvaluationException.EvaluationExceptionFactory invalidCastTarget(Class<?> from, Class<?> to) {
@@ -27,7 +23,7 @@ public EvaluationException.EvaluationExceptionFactory invalidCastTarget(Class<?>
2723
null
2824
);
2925

30-
if (this.shouldFail) {
26+
if (this.shouldThrow) {
3127
throw exception;
3228
}
3329
return exception;
@@ -44,7 +40,7 @@ public EvaluationException.EvaluationExceptionFactory castError(Class<?> from, C
4440
cause
4541
);
4642

47-
if (this.shouldFail) {
43+
if (this.shouldThrow) {
4844
throw exception;
4945
}
5046
return exception;
@@ -60,7 +56,7 @@ public EvaluationException missingAttribute(Interval interval, String expression
6056
null
6157
);
6258

63-
if (this.shouldFail) {
59+
if (this.shouldThrow) {
6460
throw exception;
6561
}
6662
return exception;
@@ -75,7 +71,7 @@ public EvaluationException cannotDispatchFunction(Interval interval, String expr
7571
cause
7672
);
7773

78-
if (this.shouldFail) {
74+
if (this.shouldThrow) {
7975
throw exception;
8076
}
8177
return exception;
@@ -91,7 +87,7 @@ public EvaluationException.EvaluationExceptionFactory functionExecutionError(Str
9187
cause
9288
);
9389

94-
if (this.shouldFail) {
90+
if (this.shouldThrow) {
9591
throw exception;
9692
}
9793
return exception;
@@ -112,7 +108,7 @@ public EvaluationException mathError(Interval interval, String expression, Strin
112108
null
113109
);
114110

115-
if (this.shouldFail) {
111+
if (this.shouldThrow) {
116112
throw exception;
117113
}
118114
return exception;

0 commit comments

Comments
 (0)