Buggy code:
public class ResourceInjectionAnnotationParsingProcessor implements DeploymentUnitProcessor { private static final DotName RESOURCE_ANNOTATION_NAME = DotName . createSimple ( Resource . class . getName ( ) ) ; private static final DotName RESOURCES_ANNOTATION_NAME = DotName . createSimple ( Resources . class . getName ( ) ) ; public static final Map < String , String > FIXED_LOCATIONS ; public static final Set < String > SIMPLE_ENTRIES ; public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final CompositeIndex index = deploymentUnit . getAttachment ( COMPOSITE_ANNOTATION_INDEX ) ; final EEApplicationClasses applicationClasses = deploymentUnit . getAttachment ( EE_APPLICATION_CLASSES_DESCRIPTION ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; <START_BUG> final boolean replacement = deploymentUnit . getAttachment ( ANNOTATION_PROPERTY_REPLACEMENT ) ; <END_BUG> final PropertyReplacer replacer = EJBAnnotationPropertyReplacement . propertyReplacer ( deploymentUnit ) ; if ( module == null ) { return ; } final List < AnnotationInstance > resourceAnnotations = index . getAnnotations ( ResourceInjectionAnnotationParsingProcessor . RESOURCE_ANNOTATION_NAME ) ; for ( AnnotationInstance annotation : resourceAnnotations ) { final AnnotationTarget annotationTarget = annotation . target ( ) ; final AnnotationValue nameValue = annotation . value ( "name" ) ; final String name = ( nameValue != null ) ? replacement ? replacer . replaceProperties ( nameValue . asString ( ) ) : nameValue . asString ( ) : null ; final AnnotationValue typeValue = annotation . value ( "type" ) ; final String type = ( typeValue != null ) ? typeValue . asClass ( ) . name ( ) . toString ( ) : null ; if ( annotationTarget instanceof FieldInfo ) { final FieldInfo fieldInfo = ( ( FieldInfo ) ( annotationTarget ) ) ; final ClassInfo classInfo = fieldInfo . declaringClass ( ) ; EEModuleClassDescription classDescription = eeModuleDescription . addOrGetLocalClassDescription ( classInfo . name ( ) . toString ( ) ) ; processFieldResource ( phaseContext , fieldInfo , name , type , classDescription , annotation , eeModuleDescription , module , applicationClasses , replacement , replacer ) ; } else if ( annotationTarget instanceof MethodInfo ) { final MethodInfo methodInfo = ( ( MethodInfo ) ( annotationTarget ) ) ; ClassInfo classInfo = methodInfo . declaringClass ( ) ; EEModuleClassDescription classDescription = eeModuleDescription . addOrGetLocalClassDescription ( classInfo . name ( ) . toString ( ) ) ; processMethodResource ( phaseContext , methodInfo , name , type , classDescription , annotation , eeModuleDescription , module , applicationClasses , replacement , replacer ) ; } else if ( annotationTarget instanceof ClassInfo ) { final ClassInfo classInfo = ( ( ClassInfo ) ( annotationTarget ) ) ; EEModuleClassDescription classDescription = eeModuleDescription . addOrGetLocalClassDescription ( classInfo . name ( ) . toString ( ) ) ; processClassResource ( phaseContext , name , type , classDescription , annotation , eeModuleDescription , module , applicationClasses , replacement , replacer ) ; } } final List < AnnotationInstance > resourcesAnnotations = index . getAnnotations ( ResourceInjectionAnnotationParsingProcessor . RESOURCES_ANNOTATION_NAME ) ; for ( AnnotationInstance outerAnnotation : resourcesAnnotations ) { final AnnotationTarget annotationTarget = outerAnnotation . target ( ) ; if ( annotationTarget instanceof ClassInfo ) { final ClassInfo classInfo = ( ( ClassInfo ) ( annotationTarget ) ) ; final AnnotationInstance [ ] values = outerAnnotation . value ( "value" ) . asNestedArray ( ) ; for ( AnnotationInstance annotation : values ) { final AnnotationValue nameValue = annotation . value ( "name" ) ; final String name = ( nameValue != null ) ? replacement ? replacer . replaceProperties ( nameValue . asString ( ) ) : nameValue . asString ( ) : null ; final AnnotationValue typeValue = annotation . value ( "type" ) ; final String type = ( typeValue != null ) ? typeValue . asClass ( ) . name ( ) . toString ( ) : null ; EEModuleClassDescription classDescription = eeModuleDescription . addOrGetLocalClassDescription ( classInfo . name ( ) . toString ( ) ) ; processClassResource ( phaseContext , name , type , classDescription , annotation , eeModuleDescription , module , applicationClasses , replacement , replacer ) ; } } } } public void undeploy ( final DeploymentUnit context ) { } protected void processFieldResource ( final DeploymentPhaseContext phaseContext , final FieldInfo fieldInfo , final String name , final String type , final EEModuleClassDescription classDescription , final AnnotationInstance annotation , final EEModuleDescription eeModuleDescription , final Module module , final EEApplicationClasses applicationClasses , final boolean replacement , final PropertyReplacer replacer ) throws DeploymentUnitProcessingException { } protected void processMethodResource ( final DeploymentPhaseContext phaseContext , final MethodInfo methodInfo , final String name , final String type , final EEModuleClassDescription classDescription , final AnnotationInstance annotation , final EEModuleDescription eeModuleDescription , final Module module , final EEApplicationClasses applicationClasses , final boolean replacement , final PropertyReplacer replacer ) throws DeploymentUnitProcessingException { } protected void processClassResource ( final DeploymentPhaseContext phaseContext , final String name , final String type , final EEModuleClassDescription classDescription , final AnnotationInstance annotation , final EEModuleDescription eeModuleDescription , final Module module , final EEApplicationClasses applicationClasses , final boolean replacement , final PropertyReplacer replacer ) throws DeploymentUnitProcessingException { } protected void process ( final DeploymentPhaseContext phaseContext , final EEModuleClassDescription classDescription , final AnnotationInstance annotation , final String injectionType , final String localContextName , final InjectionTarget targetDescription , final EEModuleDescription eeModuleDescription , final Module module , final EEApplicationClasses applicationClasses , final boolean replacement , final PropertyReplacer replacer ) throws DeploymentUnitProcessingException { } private boolean isEmpty ( final String string ) { } private boolean isEnvEntryType ( final String type , final Module module ) { } }

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