Buggy code:
public class LoggingSubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { private static final LoggingSubsystemParser INSTANCE = new LoggingSubsystemParser ( ) ; public static LoggingSubsystemParser getInstance ( ) { } private LoggingSubsystemParser ( ) { } @ Override public void readElement ( final XMLExtendedStreamReader reader , final List < ModelNode > list ) throws XMLStreamException { } static void parseLoggerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final Set < String > names ) throws XMLStreamException { } static void parseAsyncHandlerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final Set < String > names ) throws XMLStreamException { String name = null ; boolean autoflush = true ; <START_BUG> final EnumSet < Attribute > required = EnumSet . of ( FILE_NAME , NAME ) ; <END_BUG> final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; required . remove ( attribute ) ; switch ( attribute ) { case NAME : { name = value ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( ! ( required . isEmpty ( ) ) ) { throw missingRequired ( reader , required ) ; } if ( ! ( names . add ( name ) ) ) { throw duplicateNamedElement ( reader , name ) ; } String levelName = null ; ModelNode subhandlers = null ; int queueLength = 0 ; OverflowAction overflowAction = OverflowAction . BLOCK ; final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) { final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( ! ( encountered . add ( element ) ) ) { throw unexpectedElement ( reader ) ; } switch ( element ) { case CommonAttributes . LEVEL : { levelName = readStringAttributeElement ( reader , "name" ) ; break ; } case CommonAttributes . SUBHANDLERS : { subhandlers = LoggingSubsystemParser . parseHandlersElement ( reader ) ; break ; } case CommonAttributes . QUEUE_LENGTH : { queueLength = Integer . parseInt ( readStringAttributeElement ( reader , "value" ) ) ; break ; } case CommonAttributes . OVERFLOW_ACTION : { overflowAction = OverflowAction . valueOf ( readStringAttributeElement ( reader , "value" ) . toUpperCase ( Locale . US ) ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } } final ModelNode node = new ModelNode ( ) ; node . get ( OP ) . set ( ADD ) ; node . get ( OP_ADDR ) . set ( address ) . add ( CommonAttributes . ASYNC_HANDLER , name ) ; node . get ( CommonAttributes . LEVEL ) . set ( levelName ) ; if ( subhandlers != null ) node . get ( CommonAttributes . SUBHANDLERS ) . set ( subhandlers ) ; node . get ( CommonAttributes . AUTOFLUSH ) . set ( Boolean . valueOf ( autoflush ) ) ; node . get ( CommonAttributes . QUEUE_LENGTH ) . set ( queueLength ) ; node . get ( CommonAttributes . OVERFLOW_ACTION ) . set ( overflowAction . toString ( ) ) ; list . add ( node ) ; } static void parseRootLoggerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list ) throws XMLStreamException { } static void parseConsoleHandlerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final Set < String > names ) throws XMLStreamException { } static void parseFileHandlerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final Set < String > names ) throws XMLStreamException { } static void parsePeriodicRotatingFileHandlerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final Set < String > names ) throws XMLStreamException { } static void parseSizeRotatingHandlerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final Set < String > names ) throws XMLStreamException { } private static final Pattern SIZE_PATTERN = Pattern . compile ( "(\\d+)([kKmMgGbBtT])?" ) ; private static long parseSize ( final String value ) { } private static ModelNode parseFileElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static String parseFormatterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static String parsePatternFormatterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static ModelNode parseHandlersElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final SubsystemMarshallingContext context ) throws XMLStreamException { } private void writeConsoleHandler ( final XMLExtendedStreamWriter writer , final ModelNode node , final String name ) throws XMLStreamException { } private void writeFileHandler ( final XMLExtendedStreamWriter writer , final ModelNode node , final String name ) throws XMLStreamException { } private void writePeriodicRotatingFileHandler ( final XMLExtendedStreamWriter writer , final ModelNode node , final String name ) throws XMLStreamException { } private void writeSizeRotatingFileHandler ( final XMLExtendedStreamWriter writer , final ModelNode node , final String name ) throws XMLStreamException { } private void writeAsynchHandler ( final XMLExtendedStreamWriter writer , final ModelNode node , final String name ) throws XMLStreamException { } private void writeLogger ( final XMLExtendedStreamWriter writer , String name , final ModelNode node ) throws XMLStreamException { } private void writeRootLogger ( final XMLExtendedStreamWriter writer , final ModelNode node ) throws XMLStreamException { }

Fix:
final EnumSet < Attribute > required = EnumSet . of ( NAME ) ;