Buggy code:
public class EjbResourceInjectionAnnotationProcessor implements DeploymentUnitProcessor { private static final DotName EJB_ANNOTATION_NAME = DotName . createSimple ( EJB . class . getName ( ) ) ; private static final DotName EJBS_ANNOTATION_NAME = DotName . createSimple ( EJBs . class . getName ( ) ) ; private final boolean appclient ; private static final Logger logger = Logger . getLogger ( EjbResourceInjectionAnnotationProcessor . class ) ; public EjbResourceInjectionAnnotationProcessor ( final boolean appclient ) { } public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final CompositeIndex index = deploymentUnit . getAttachment ( COMPOSITE_ANNOTATION_INDEX ) ; final List < AnnotationInstance > resourceAnnotations = index . getAnnotations ( EjbResourceInjectionAnnotationProcessor . EJB_ANNOTATION_NAME ) ; <START_BUG> final Boolean replacement = deploymentUnit . getAttachment ( ANNOTATION_PROPERTY_REPLACEMENT ) ; <END_BUG> for ( AnnotationInstance annotation : resourceAnnotations ) { final AnnotationTarget annotationTarget = annotation . target ( ) ; final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotationWrapper = new EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper ( annotation , replacement ) ; if ( annotationTarget instanceof FieldInfo ) { processField ( deploymentUnit , annotationWrapper , ( ( FieldInfo ) ( annotationTarget ) ) , moduleDescription ) ; } else if ( annotationTarget instanceof MethodInfo ) { processMethod ( deploymentUnit , annotationWrapper , ( ( MethodInfo ) ( annotationTarget ) ) , moduleDescription ) ; } else if ( annotationTarget instanceof ClassInfo ) { processClass ( deploymentUnit , annotationWrapper , ( ( ClassInfo ) ( annotationTarget ) ) , moduleDescription ) ; } } final List < AnnotationInstance > ejbsAnnotations = index . getAnnotations ( EjbResourceInjectionAnnotationProcessor . EJBS_ANNOTATION_NAME ) ; for ( AnnotationInstance annotation : ejbsAnnotations ) { final AnnotationTarget annotationTarget = annotation . target ( ) ; if ( annotationTarget instanceof ClassInfo ) { final AnnotationValue annotationValue = annotation . value ( ) ; final AnnotationInstance [ ] ejbAnnotations = annotationValue . asNestedArray ( ) ; for ( AnnotationInstance ejbAnnotation : ejbAnnotations ) { final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotationWrapper = new EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper ( ejbAnnotation , replacement ) ; processClass ( deploymentUnit , annotationWrapper , ( ( ClassInfo ) ( annotationTarget ) ) , moduleDescription ) ; } } else { throw EjbMessages . MESSAGES . annotationOnlyAllowedOnClass ( EJBs . class . getName ( ) , annotation . target ( ) ) ; } } } public void undeploy ( DeploymentUnit context ) { } private void processField ( final DeploymentUnit deploymentUnit , final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotation , final FieldInfo fieldInfo , final EEModuleDescription eeModuleDescription ) { } private void processMethod ( final DeploymentUnit deploymentUnit , final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotation , final MethodInfo methodInfo , final EEModuleDescription eeModuleDescription ) { } private void processClass ( final DeploymentUnit deploymentUnit , final EjbResourceInjectionAnnotationProcessor . EJBResourceWrapper annotation , final ClassInfo classInfo , final EEModuleDescription eeModuleDescription ) throws DeploymentUnitProcessingException { } private void process ( final DeploymentUnit deploymentUnit , final String beanInterface , final String beanName , final String lookup , final ClassInfo classInfo , final InjectionTarget targetDescription , final String localContextName , final EEModuleDescription eeModuleDescription ) { } private InjectionSource createLookup ( final String localContextName , final boolean appclient ) { } private boolean isEmpty ( final String string ) { } private class EJBResourceWrapper { private final String name ; private final String beanInterface ; private final String beanName ; private final String lookup ; private final String description ; private final boolean replacement ; private EJBResourceWrapper ( final AnnotationInstance annotation , final boolean replacement ) { } private String name ( ) { } private String beanInterface ( ) { } private String beanName ( ) { } private String lookup ( ) { } private String description ( ) { } private String stringValueOrNull ( final AnnotationInstance annotation , final String attribute ) { } private String classValueOrNull ( final AnnotationInstance annotation , final String attribute ) { } } }

Fix:
final Boolean replacement = deploymentUnit . getAttachment ( EJB_ANNOTATION_PROPERTY_REPLACEMENT ) ;