Skip to content

Commit

Permalink
Revert final and toString cleanup.
Browse files Browse the repository at this point in the history
Signed-off-by: currantw <[email protected]>
  • Loading branch information
currantw committed Oct 23, 2024
1 parent 1d02e82 commit 809e7e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static void register(BuiltinFunctionRepository repository) {
* </tr>
* </table>
*/
private static final Table<ExprValue, ExprValue, ExprValue> andTable =
private static Table<ExprValue, ExprValue, ExprValue> andTable =
new ImmutableTable.Builder<ExprValue, ExprValue, ExprValue>()
.put(LITERAL_TRUE, LITERAL_TRUE, LITERAL_TRUE)
.put(LITERAL_TRUE, LITERAL_FALSE, LITERAL_FALSE)
Expand Down Expand Up @@ -195,7 +195,7 @@ public static void register(BuiltinFunctionRepository repository) {
* </tr>
* </table>
*/
private static final Table<ExprValue, ExprValue, ExprValue> orTable =
private static Table<ExprValue, ExprValue, ExprValue> orTable =
new ImmutableTable.Builder<ExprValue, ExprValue, ExprValue>()
.put(LITERAL_TRUE, LITERAL_TRUE, LITERAL_TRUE)
.put(LITERAL_TRUE, LITERAL_FALSE, LITERAL_TRUE)
Expand Down Expand Up @@ -270,7 +270,7 @@ public static void register(BuiltinFunctionRepository repository) {
* </tr>
* </table>
*/
private static final Table<ExprValue, ExprValue, ExprValue> xorTable =
private static Table<ExprValue, ExprValue, ExprValue> xorTable =
new ImmutableTable.Builder<ExprValue, ExprValue, ExprValue>()
.put(LITERAL_TRUE, LITERAL_TRUE, LITERAL_FALSE)
.put(LITERAL_TRUE, LITERAL_FALSE, LITERAL_TRUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

class BinaryPredicateOperatorTest extends ExpressionTestBase {

private static final List<StringPatternPair> STRING_PATTERN_PAIRS =
private static List<StringPatternPair> STRING_PATTERN_PAIRS =
ImmutableList.of(
new StringPatternPair("Michael!", ".*"),
new StringPatternPair("new*\\n*line", "new\\\\*.\\\\*line"),
Expand Down Expand Up @@ -233,7 +233,7 @@ public void test_and(Boolean v1, Boolean v2) {
FunctionExpression and = DSL.and(DSL.literal(booleanValue(v1)), DSL.literal(booleanValue(v2)));
assertEquals(BOOLEAN, and.type());
assertEquals(v1 && v2, ExprValueUtils.getBooleanValue(and.valueOf(valueEnv())));
assertEquals(String.format("and(%s, %s)", v1, v2.toString()), and.toString());
assertEquals(String.format("and(%s, %s)", v1.toString(), v2.toString()), and.toString());
}

@Test
Expand Down Expand Up @@ -313,7 +313,7 @@ public void test_or(Boolean v1, Boolean v2) {
FunctionExpression or = DSL.or(DSL.literal(booleanValue(v1)), DSL.literal(booleanValue(v2)));
assertEquals(BOOLEAN, or.type());
assertEquals(v1 || v2, ExprValueUtils.getBooleanValue(or.valueOf(valueEnv())));
assertEquals(String.format("or(%s, %s)", v1, v2.toString()), or.toString());
assertEquals(String.format("or(%s, %s)", v1.toString(), v2.toString()), or.toString());
}

@Test
Expand Down Expand Up @@ -393,7 +393,7 @@ public void test_xor(Boolean v1, Boolean v2) {
FunctionExpression xor = DSL.xor(DSL.literal(booleanValue(v1)), DSL.literal(booleanValue(v2)));
assertEquals(BOOLEAN, xor.type());
assertEquals(v1 ^ v2, ExprValueUtils.getBooleanValue(xor.valueOf(valueEnv())));
assertEquals(String.format("xor(%s, %s)", v1, v2), xor.toString());
assertEquals(String.format("xor(%s, %s)", v1.toString(), v2.toString()), xor.toString());
}

@Test
Expand Down Expand Up @@ -573,7 +573,7 @@ public void test_like(ExprValue v1, ExprValue v2) {
FunctionExpression like = DSL.like(DSL.literal(v1), DSL.literal(v2));
assertEquals(BOOLEAN, like.type());
assertEquals(matches(v1, v2), like.valueOf(valueEnv()));
assertEquals(String.format("like(%s, %s)", v1, v2), like.toString());
assertEquals(String.format("like(%s, %s)", v1.toString(), v2.toString()), like.toString());
}

@Test
Expand Down

0 comments on commit 809e7e6

Please sign in to comment.