Skip to content

Commit

Permalink
FISH-10136 Add fallout for if field doesn't exist
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Pielage <[email protected]>
  • Loading branch information
Pandrex247 committed Nov 13, 2024
1 parent 8e81c2f commit dac70f4
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2673,8 +2673,16 @@ private void clearBeanELResolverCache() {
private void clearBeanResolver(Class<?> elUtilsClass) throws Exception {
Optional<Class<?>> elResolverClass = Optional.ofNullable(CachingReflectionUtil
.getClassFromCache("jakarta.el.BeanELResolver", this));
Object resolver = CachingReflectionUtil.getFieldFromCache(elUtilsClass, "BEAN_RESOLVER",
false).get(null);

Field field = CachingReflectionUtil.getFieldFromCache(elUtilsClass, "BEAN_RESOLVER", false);
if (field == null) {
logger.log(Level.FINE, "Could not find BEAN_RESOLVER field on {0}", elUtilsClass.getName());
return;
}

// TODO: Review whether this is still required; Mojarra may have fixed this themselves in PR#5479?
// Is there solution enough? Do we need to retain this for cases where another Faces implementation is being provided?
Object resolver = field.get(null);
if (resolver != null && elResolverClass.isPresent()) {
logger.fine(String.format("Fields: %s", Arrays.stream(elResolverClass.get().getDeclaredFields())
.map(Field::toString).collect(Collectors.toList())));
Expand Down

0 comments on commit dac70f4

Please sign in to comment.