Buggy code:
public class UndertowDeploymentInfoService implements Service < DeploymentInfo > { public static final ServiceName SERVICE_NAME = ServiceName . of ( "UndertowDeploymentInfoService" ) ; private DeploymentInfo deploymentInfo ; private final JBossWebMetaData mergedMetaData ; private final String deploymentName ; private final TldsMetaData tldsMetaData ; private final List < TldMetaData > sharedTlds ; private final Module module ; private final DeploymentClassIndex classReflectionIndex ; private final WebInjectionContainer injectionContainer ; private final ComponentRegistry componentRegistry ; private final ScisMetaData scisMetaData ; private final VirtualFile deploymentRoot ; private final String securityContextId ; private final List < ServletContextAttribute > attributes ; private final String contextPath ; private final List < SetupAction > setupActions ; private final InjectedValue < UndertowService > undertowService = new InjectedValue ( ) ; private final InjectedValue < DistributedCacheManagerFactory > distributedCacheManagerFactoryInjectedValue = new InjectedValue < DistributedCacheManagerFactory > ( ) ; private final InjectedValue < SecurityDomainContext > securityDomainContextValue = new InjectedValue < SecurityDomainContext > ( ) ; private final InjectedValue < ServletContainerService > container = new InjectedValue ( ) ; private final InjectedValue < DirectBufferCache > bufferCacheInjectedValue = new InjectedValue ( ) ; public UndertowDeploymentInfoService ( final JBossWebMetaData mergedMetaData , final String deploymentName , final TldsMetaData tldsMetaData , final List < TldMetaData > sharedTlds , final Module module , final DeploymentClassIndex classReflectionIndex , final WebInjectionContainer injectionContainer , final ComponentRegistry componentRegistry , final ScisMetaData scisMetaData , final VirtualFile deploymentRoot , final String securityContextId , final List < ServletContextAttribute > attributes , final String contextPath , final List < SetupAction > setupActions ) { } @ Override public synchronized void start ( final StartContext startContext ) throws StartException { } @ Override public synchronized void stop ( final StopContext stopContext ) { } @ Override public synchronized DeploymentInfo getValue ( ) throws IllegalArgumentException , IllegalStateException { } private void handleIdentityManager ( final DeploymentInfo deploymentInfo ) { SecurityDomainContext sdc = securityDomainContextValue . getValue ( ) ; deploymentInfo . setIdentityManager ( new org . wildfly . extension . undertow . security . JAASIdentityManagerImpl ( sdc , mergedMetaData . getPrincipalVersusRolesMap ( ) ) ) ; AuditManager auditManager = sdc . getAuditManager ( ) ; <START_BUG> if ( auditManager != null ) { <END_BUG> deploymentInfo . addNotificationReceiver ( new org . wildfly . extension . undertow . security . AuditNotificationReceiver ( auditManager ) ) ; } deploymentInfo . setConfidentialPortManager ( getConfidentialPortManager ( ) ) ; } private ConfidentialPortManager getConfidentialPortManager ( ) { } private void handleSessionReplication ( final DeploymentInfo deploymentInfo ) { } private DeploymentInfo createServletConfig ( ) throws StartException { } private static String authMethod ( String configuredMethod ) { } private static TransportGuaranteeType transportGuaranteeType ( final TransportGuaranteeType type ) { } private static HashMap < String , JspPropertyGroup > createJspConfig ( JBossWebMetaData metaData ) { } private static HashMap < String , TagLibraryInfo > createTldsInfo ( final TldsMetaData tldsMetaData , List < TldMetaData > sharedTlds , final DeploymentClassIndex classReflectionIndex , final ComponentRegistry components , final DeploymentInfo d ) throws ClassNotFoundException { } private static TagLibraryInfo createTldInfo ( final String location , final TldMetaData tldMetaData , final HashMap < String , TagLibraryInfo > ret , final DeploymentClassIndex classReflectionIndex , final ComponentRegistry components , final DeploymentInfo d ) throws ClassNotFoundException { } private static void addListener ( final DeploymentClassIndex classReflectionIndex , final ComponentRegistry components , final DeploymentInfo d , final ListenerMetaData listener ) throws ClassNotFoundException { } private static < T > InstanceFactory < T > createInstanceFactory ( final ComponentRegistry . ComponentManagedReferenceFactory creator ) { } public InjectedValue < ServletContainerService > getContainer ( ) { } public InjectedValue < SecurityDomainContext > getSecurityDomainContextValue ( ) { } public InjectedValue < DistributedCacheManagerFactory > getDistributedCacheManagerFactoryInjectedValue ( ) { } public InjectedValue < UndertowService > getUndertowService ( ) { } public InjectedValue < DirectBufferCache > getBufferCacheInjectedValue ( ) { } private static class ComponentClassIntrospector implements ClassIntrospecter { private final ComponentRegistry componentRegistry ; public ComponentClassIntrospector ( final ComponentRegistry componentRegistry ) { } @ Override public < T > InstanceFactory < T > createInstanceFactory ( final Class < T > clazz ) { } } private static class ManagedReferenceInstanceFactory < T > implements InstanceFactory < T > { private final ComponentManagedReferenceFactory component ; public ManagedReferenceInstanceFactory ( final ComponentRegistry . ComponentManagedReferenceFactory component ) { } @ Override public InstanceHandle < T > createInstance ( ) throws InstantiationException { } } public static UndertowDeploymentInfoService . Builder builder ( ) { } public static class Builder { private JBossWebMetaData mergedMetaData ; private String deploymentName ; private TldsMetaData tldsMetaData ; private List < TldMetaData > sharedTlds ; private Module module ; private DeploymentClassIndex classReflectionIndex ; private WebInjectionContainer injectionContainer ; private ComponentRegistry componentRegistry ; private ScisMetaData scisMetaData ; private VirtualFile deploymentRoot ; private String securityContextId ; private List < ServletContextAttribute > attributes ; private String contextPath ; private List < SetupAction > setupActions ; UndertowDeploymentInfoService . Builder setMergedMetaData ( final JBossWebMetaData mergedMetaData ) { } public UndertowDeploymentInfoService . Builder setDeploymentName ( final String deploymentName ) { } public UndertowDeploymentInfoService . Builder setTldsMetaData ( final TldsMetaData tldsMetaData ) { } public UndertowDeploymentInfoService . Builder setSharedTlds ( final List < TldMetaData > sharedTlds ) { } public UndertowDeploymentInfoService . Builder setModule ( final Module module ) { } public UndertowDeploymentInfoService . Builder setClassReflectionIndex ( final DeploymentClassIndex classReflectionIndex ) { } public UndertowDeploymentInfoService . Builder setInjectionContainer ( final WebInjectionContainer injectionContainer ) { } public UndertowDeploymentInfoService . Builder setComponentRegistry ( final ComponentRegistry componentRegistry ) { } public UndertowDeploymentInfoService . Builder setScisMetaData ( final ScisMetaData scisMetaData ) { } public UndertowDeploymentInfoService . Builder setDeploymentRoot ( final VirtualFile deploymentRoot ) { } public UndertowDeploymentInfoService . Builder setSecurityContextId ( final String securityContextId ) { } public UndertowDeploymentInfoService . Builder setAttributes ( final List < ServletContextAttribute > attributes ) { } public UndertowDeploymentInfoService . Builder setContextPath ( final String contextPath ) { } public UndertowDeploymentInfoService . Builder setSetupActions ( final List < SetupAction > setupActions ) { } public UndertowDeploymentInfoService createUndertowDeploymentInfoService ( ) { } } private static final class ImmediateSessionManagerFactory implements SessionManagerFactory { private final SessionManager sessionManager ; private ImmediateSessionManagerFactory ( final SessionManager sessionManager ) { } @ Override public SessionManager createSessionManager ( final Deployment deployment ) { } } }

Fix:
if ( ( auditManager != null ) && ( ! ( mergedMetaData . isDisableAudit ( ) ) ) ) {