Skip to content
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

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

kusalk
Copy link
Member

@kusalk kusalk commented Aug 31, 2023

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 1

Functionally, there are only 2 changes:

  • Removed redundant tree validation from OgnlUtil#setValue
  • Cache expressions prior to tree validation (i.e. even if validation fails)

@kusalk kusalk marked this pull request as ready for review August 31, 2023 07:39
@sonarcloud
Copy link

sonarcloud bot commented Aug 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

95.1% 95.1% Coverage
0.0% 0.0% Duplication

Copy link
Member

@lukaszlenart lukaszlenart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@lukaszlenart lukaszlenart merged commit 19d26b2 into master Sep 26, 2023
8 checks passed
@lukaszlenart lukaszlenart deleted the WW-5340-ognlutil-refactor branch September 26, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants