@@ -112,22 +112,7 @@ public Program createProgram(CelAbstractSyntaxTree ast) throws CelEvaluationExce
112112 return toRuntimeProgram (planner ().plan (ast ));
113113 }
114114
115- private static final CelFunctionResolver EMPTY_FUNCTION_RESOLVER =
116- new CelFunctionResolver () {
117- @ Override
118- public Optional <CelResolvedOverload > findOverloadMatchingArgs (
119- String functionName , Collection <String > overloadIds , Object [] args ) {
120- return Optional .empty ();
121- }
122-
123- @ Override
124- public Optional <CelResolvedOverload > findOverloadMatchingArgs (
125- String functionName , Object [] args ) {
126- return Optional .empty ();
127- }
128- };
129-
130- public Program toRuntimeProgram (dev .cel .runtime .Program program ) {
115+ private Program toRuntimeProgram (dev .cel .runtime .Program program ) {
131116 return new Program () {
132117
133118 @ Override
@@ -152,7 +137,7 @@ public Object eval(Message message) throws CelEvaluationException {
152137 return plannedProgram .evalOrThrow (
153138 plannedProgram .interpretable (),
154139 ProtoMessageActivationFactory .fromProto (message , plannedProgram .options ()),
155- EMPTY_FUNCTION_RESOLVER ,
140+ CelFunctionResolver . EMPTY ,
156141 /* partialVars= */ null ,
157142 /* listener= */ null );
158143 }
@@ -215,14 +200,14 @@ public ListenableFuture<Object> evalAsync(PartialVars partialVars) {
215200 @ Override
216201 public Object trace (CelEvaluationListener listener ) throws CelEvaluationException {
217202 return ((PlannedProgram ) program )
218- .trace (GlobalResolver .EMPTY , EMPTY_FUNCTION_RESOLVER , null , listener );
203+ .trace (GlobalResolver .EMPTY , CelFunctionResolver . EMPTY , null , listener );
219204 }
220205
221206 @ Override
222207 public Object trace (Map <String , ?> mapValue , CelEvaluationListener listener )
223208 throws CelEvaluationException {
224209 return ((PlannedProgram ) program )
225- .trace (Activation .copyOf (mapValue ), EMPTY_FUNCTION_RESOLVER , null , listener );
210+ .trace (Activation .copyOf (mapValue ), CelFunctionResolver . EMPTY , null , listener );
226211 }
227212
228213 @ Override
@@ -232,7 +217,7 @@ public Object trace(Message message, CelEvaluationListener listener)
232217 return plannedProgram .evalOrThrow (
233218 plannedProgram .interpretable (),
234219 ProtoMessageActivationFactory .fromProto (message , plannedProgram .options ()),
235- EMPTY_FUNCTION_RESOLVER ,
220+ CelFunctionResolver . EMPTY ,
236221 /* partialVars= */ null ,
237222 listener );
238223 }
@@ -243,7 +228,7 @@ public Object trace(CelVariableResolver resolver, CelEvaluationListener listener
243228 return ((PlannedProgram ) program )
244229 .trace (
245230 (name ) -> resolver .find (name ).orElse (null ),
246- EMPTY_FUNCTION_RESOLVER ,
231+ CelFunctionResolver . EMPTY ,
247232 null ,
248233 listener );
249234 }
@@ -278,13 +263,13 @@ public Object trace(PartialVars partialVars, CelEvaluationListener listener)
278263 return ((PlannedProgram ) program )
279264 .trace (
280265 (name ) -> partialVars .resolver ().find (name ).orElse (null ),
281- EMPTY_FUNCTION_RESOLVER ,
266+ CelFunctionResolver . EMPTY ,
282267 partialVars ,
283268 listener );
284269 }
285270
286271 @ Override
287- public Object advanceEvaluation (UnknownContext context ) throws CelEvaluationException {
272+ public Object advanceEvaluation (UnknownContext context ) {
288273 throw new UnsupportedOperationException ("Unsupported operation." );
289274 }
290275 };
0 commit comments