Buggy code:
public class LoggingSubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { static final LoggingSubsystemParser INSTANCE = new LoggingSubsystemParser ( ) ; 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 { } 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 { String name = null ; boolean autoflush = true ; final EnumSet < Attribute > required = EnumSet . of ( NAME ) ; 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 CommonAttributes . NAME : { name = value ; break ; } case CommonAttributes . AUTOFLUSH : { autoflush = Boolean . parseBoolean ( value ) ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( ! ( required . isEmpty ( ) ) ) { throw missingRequired ( reader , required ) ; } if ( ! ( names . add ( name ) ) ) { throw duplicateNamedElement ( reader , name ) ; } final ModelNode node = new ModelNode ( ) ; node . get ( OP ) . set ( ADD ) ; node . get ( OP_ADDR ) . set ( address ) . add ( CommonAttributes . CONSOLE_HANDLER , name ) ; node . get ( CommonAttributes . NAME . getName ( ) ) . set ( name ) ; node . get ( CommonAttributes . AUTOFLUSH . getName ( ) ) . set ( autoflush ) ; 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 ) ; } final Location location = reader . getLocation ( ) ; switch ( element ) { case CommonAttributes . LEVEL : { CommonAttributes . LEVEL . parseAndSetParameter ( readStringAttributeElement ( reader , "name" ) , node , location ) ; break ; } case CommonAttributes . ENCODING : { CommonAttributes . ENCODING . parseAndSetParameter ( readStringAttributeElement ( reader , "value" ) , node , location ) ; break ; } case CommonAttributes . FORMATTER : { CommonAttributes . FORMATTER . parseAndSetParameter ( LoggingSubsystemParser . parseFormatterElement ( reader ) , node , location ) ; break ; } case CommonAttributes . TARGET : { final String target = readStringAttributeElement ( reader , "name" ) ; if ( ! ( ( target . equals ( "System.out" ) ) || ( target . equals ( "System.err" ) ) ) ) { <START_BUG> throw new XMLStreamException ( LoggingMessages . MESSAGES . invalidTargetName ( ) , reader . getLocation ( ) ) ; <END_BUG> } CommonAttributes . TARGET . parseAndSetParameter ( target , node , location ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } } list . add ( node ) ; } static void parseFileHandlerElement ( final XMLExtendedStreamReader reader , final ModelNode address , final List < ModelNode > list , final Set < String > names ) throws XMLStreamException { } static void parseCustomHandlerElement ( 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])?" ) ; public static long parseSize ( final String value ) { } private static void parseFileElement ( final ModelNode node , 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 void parsePropertyElement ( final ModelNode node , final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static void parseHandlersElement ( final ModelNode node , 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 writeCustomHandler ( final XMLExtendedStreamWriter writer , final ModelNode node , final String name ) throws XMLStreamException { }

Fix:
throw new XMLStreamException ( LoggingMessages . MESSAGES . invalidTargetName ( EnumSet . allOf ( Target . class ) ) , reader . getLocation ( ) ) ;