You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This @Plugin doesn't behave like most others where if the configuration is invalid, it will return a null from the Builder.
The @PluginBuilderAttributefactoryClassName (for the XML class attribute) is marked as @Required, but if creating programatically the missing value is not checked and the constructor will throw a NPE.
@Override
public AsyncWaitStrategyFactoryConfig build() {
return new AsyncWaitStrategyFactoryConfig(factoryClassName);
}
public AsyncWaitStrategyFactoryConfig(final String factoryClassName) {
this.factoryClassName = Objects.requireNonNull(factoryClassName, "factoryClassName");
}
Typical behaviour here would be to return null from the build() method if misconfigured.
adding a NotEmpty check to the Builder#withFactoryClassName(...) method might be sensible.
adding a NotEmpty check to the constructor might be sensible (an empty string here makes no sense)
The text was updated successfully, but these errors were encountered:
AsyncWaitStrategyFactoryConfig (Log4j 2.24.1)
This
@Plugin
doesn't behave like most others where if the configuration is invalid, it will return anull
from the Builder.The
@PluginBuilderAttribute
factoryClassName
(for the XMLclass
attribute) is marked as@Required
, but if creating programatically the missing value is not checked and the constructor will throw a NPE.Typical behaviour here would be to return
null
from thebuild()
method if misconfigured.Builder#withFactoryClassName(...)
method might be sensible.The text was updated successfully, but these errors were encountered: