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

Add protected getReadMethod #1028

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/com/hubspot/jinjava/el/ext/BeanELResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public Object getValue(ELContext context, Object base, Object property) {
}
Object result = null;
if (isResolvable(base)) {
Method method = toBeanProperty(base, property).getReadMethod();
Method method = getReadMethod(base, property);
if (method == null) {
throw new PropertyNotFoundException("Cannot read property " + property);
}
Expand Down Expand Up @@ -649,6 +649,10 @@ protected Object[] coerceParams(
return args;
}

protected Method getReadMethod(Object base, Object property) {
return toBeanProperty(base, property).getReadMethod();
}

private void coerceValue(
Object array,
int index,
Expand Down