-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WW-5340 Preliminary refactor of OgnlUtil #746
Conversation
14d3435
to
65ff242
Compare
@@ -592,58 +582,55 @@ | |||
} | |||
|
|||
public Object getValue(final String name, final Map<String, Object> context, final Object root) throws OgnlException { | |||
return compileAndExecute(name, context, tree -> Ognl.getValue(tree, context, root)); | |||
return getValue(name, context, root, null); |
Check failure
Code scanning / CodeQL
OGNL Expression Language statement with user-controlled input
} | ||
Ognl.setValue(tree, context, root, value); |
Check failure
Code scanning / CodeQL
OGNL Expression Language statement with user-controlled input
for (TreeValidator validator : treeValidators) { | ||
validator.validate(tree, checkContext); | ||
} | ||
return (T) Ognl.getValue(tree, context, root, resultType); |
Check failure
Code scanning / CodeQL
OGNL Expression Language statement with user-controlled input
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
WW-5340
I've refactored this class to improve both readability and maintainability.
My primary goal was to consolidate calls to ognl.Ognl, specifically the following functions:
#getValue
: 5 calls to 1#setValue
: 2 calls to 1#parseExpression
: 4 calls to 1Functionally, there are only 2 changes:
OgnlUtil#setValue