https://bz.apache.org/bugzilla/show_bug.cgi?id=70163

--- Comment #2 from Timofei <[email protected]> ---
I sincerely apologize for the confusion in the original description. You are
completely correct; I misstated the current behavior of the code. 

The current code in StoreConfigLifecycleListener.getManagedBean() does NOT
throw an IllegalStateException. It currently dereferences the result of
findManagedBean() directly without any null check:

ManagedBean managedBean = registry.findManagedBean("StoreConfig");
return managedBean.createMBean(object);

Because findManagedBean() can return null, this direct dereference causes a
potential NullPointerException (as flagged by the Svace static analyzer).

The proposed patch adds a missing null check. I chose to return null to allow
the caller to handle the missing configuration gracefully. However, if throwing
an IllegalStateException is the preferred Tomcat pattern for a missing required
MBean during startup, I am happy to update the patch to do that instead.

Again, apologies for the inaccurate description. This was my error in analyzing
the existing code.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to