Skip to content

Commit 256392a

Browse files
committed
Use a pre-built exception.
1 parent 0c058a1 commit 256392a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/hubspot/jinjava/el/ext/BeanELResolver.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
* @see ELResolver
5656
*/
5757
public class BeanELResolver extends ELResolver {
58+
private static PropertyNotFoundException propertyNotFoundException = new PropertyNotFoundException(
59+
"Could not find property"
60+
);
5861

5962
protected static final class BeanProperties {
6063
private final Map<String, BeanProperty> map = new HashMap<String, BeanProperty>();
@@ -700,9 +703,7 @@ private BeanProperty toBeanProperty(Object base, Object property) {
700703
? null
701704
: beanProperties.getBeanProperty(property.toString());
702705
if (beanProperty == null) {
703-
throw new PropertyNotFoundException(
704-
"Could not find property " + property + " in " + base.getClass()
705-
);
706+
throw propertyNotFoundException;
706707
}
707708
return beanProperty;
708709
}

0 commit comments

Comments
 (0)