4343import dev .cel .common .types .CelTypes ;
4444import dev .cel .common .values .CelValueProvider ;
4545import dev .cel .common .values .ProtoMessageValueProvider ;
46- import dev .cel .runtime .CelStandardFunctions . StandardFunction . Overload . Arithmetic ;
47- import dev .cel .runtime .CelStandardFunctions . StandardFunction . Overload . Comparison ;
48- import dev .cel .runtime .CelStandardFunctions . StandardFunction . Overload . Conversions ;
46+ import dev .cel .runtime .standard . AddOperator . AddOverload ;
47+ import dev .cel .runtime .standard . IntFunction . IntOverload ;
48+ import dev .cel .runtime .standard . TimestampFunction . TimestampOverload ;
4949import java .util .Arrays ;
5050import java .util .HashMap ;
5151import java .util .Optional ;
@@ -339,7 +339,7 @@ private ImmutableSet<CelFunctionBinding> newStandardFunctionBindings(
339339 (standardFunction , standardOverload ) -> {
340340 switch (standardFunction ) {
341341 case INT :
342- if (standardOverload .equals (Conversions .INT64_TO_INT64 )) {
342+ if (standardOverload .equals (IntOverload .INT64_TO_INT64 )) {
343343 // Note that we require UnsignedLong flag here to avoid ambiguous
344344 // overloads against "uint64_to_int64", because they both use the same
345345 // Java Long class. We skip adding this identity function if the flag is
@@ -350,26 +350,23 @@ private ImmutableSet<CelFunctionBinding> newStandardFunctionBindings(
350350 case TIMESTAMP :
351351 // TODO: Remove this flag guard once the feature has been
352352 // auto-enabled.
353- if (standardOverload .equals (Conversions .INT64_TO_TIMESTAMP )) {
353+ if (standardOverload .equals (TimestampOverload .INT64_TO_TIMESTAMP )) {
354354 return options .enableTimestampEpoch ();
355355 }
356356 break ;
357357 case STRING :
358358 return options .enableStringConversion ();
359359 case ADD :
360- Arithmetic arithmetic = (Arithmetic ) standardOverload ;
361- if (arithmetic .equals (Arithmetic .ADD_STRING )) {
360+ if (standardOverload .equals (AddOverload .ADD_STRING )) {
362361 return options .enableStringConcatenation ();
363362 }
364- if (arithmetic .equals (Arithmetic .ADD_LIST )) {
363+ if (standardOverload .equals (AddOverload .ADD_LIST )) {
365364 return options .enableListConcatenation ();
366365 }
367366 break ;
368367 default :
369- if (standardOverload instanceof Comparison
370- && !options .enableHeterogeneousNumericComparisons ()) {
371- Comparison comparison = (Comparison ) standardOverload ;
372- return !comparison .isHeterogeneousComparison ();
368+ if (!options .enableHeterogeneousNumericComparisons ()) {
369+ return !CelStandardFunctions .isHeterogeneousComparison (standardOverload );
373370 }
374371 break ;
375372 }
0 commit comments