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-5363 Velocity: read chained contexts before ValueStack #789

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

kusalk
Copy link
Member

@kusalk kusalk commented Nov 13, 2023

WW-5363

I think it's probably a fair assumption that in most applications that the OgnlValueStack lookup will be the most expensive context lookup. Given that, it is probably better we do that last. I've refactored this class slightly to make the lookup order easily overridable.

@kusalk kusalk marked this pull request as draft November 13, 2023 13:39
@kusalk kusalk force-pushed the issue/WW-5363-velocity-order branch from 926a846 to 86498fd Compare November 13, 2023 14:55
@kusalk kusalk force-pushed the issue/WW-5363-velocity-order branch from 86498fd to aff5a55 Compare November 13, 2023 14:57
}

protected List<Function<String, Object>> contextGetterList() {
return Arrays.asList(super::internalGet, this::chainedContextGet, this::stackGet, this::stackContextGet);
Copy link
Member Author

@kusalk kusalk Nov 13, 2023

Choose a reason for hiding this comment

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

Happy to revert this back to the original order if you think that's a more sensible default - at least now it is easily overridable

Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine, we will see if this will produce some backward incompatibility

@kusalk kusalk force-pushed the issue/WW-5363-velocity-order branch from aff5a55 to cf9e535 Compare November 13, 2023 15:02
Copy link

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@kusalk kusalk marked this pull request as ready for review November 13, 2023 15:18
@kusalk kusalk requested a review from lukaszlenart November 13, 2023 15:18
@kusalk kusalk merged commit f989f37 into master Nov 14, 2023
10 checks passed
@kusalk kusalk deleted the issue/WW-5363-velocity-order branch November 14, 2023 13:37
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