Skip to content

Commit

Permalink
Fix profile determination in function calls
Browse files Browse the repository at this point in the history
Argument evaluation was done with the wrong profile.
  • Loading branch information
mederly committed Aug 10, 2023
1 parent c3d02fa commit f43994a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ public PrismValueDeltaSetTriple<V> evaluate(ExpressionEvaluationContext context,

Expression<V, D> argumentExpression = context.getExpressionFactory()
.makeExpression(
argumentExpressionCI, argumentValueDefinition,
ExpressionProfile.none(), // a profile should be set in the context
argumentExpressionCI,
argumentValueDefinition,
context.getExpressionProfile(), // this is the caller's profile
shortDesc, context.getTask(), argumentResult);

PrismValueDeltaSetTriple<V> argumentValueTriple = argumentExpression.evaluate(context, argumentResult);
Expand All @@ -137,8 +138,7 @@ public PrismValueDeltaSetTriple<V> evaluate(ExpressionEvaluationContext context,

functionVariables.addVariableDefinition(argumentName, argumentValue, argumentValueDefinition);

} catch (SchemaException | ExpressionEvaluationException | ObjectNotFoundException | CommunicationException
| ConfigurationException | SecurityViolationException e) {
} catch (Exception e) {
argumentResult.recordException("Failed to resolve argument: " + argumentName + ". Reason: " + e.getMessage(), e);
throw e;
} finally {
Expand Down

0 comments on commit f43994a

Please sign in to comment.