Buggy code:
public final class LoggingSubsystemParser implements XMLStreamConstants , XMLElementReader < ParseResult < ? super LoggingSubsystemElement > > { public void readElement ( final XMLExtendedStreamReader reader , final ParseResult < ? super LoggingSubsystemElement > result ) throws XMLStreamException { } private static XMLStreamException unexpectedAttribute ( final XMLExtendedStreamReader reader , final int index ) { } private static XMLStreamException duplicateNamedElement ( final XMLExtendedStreamReader reader , final String name ) { } private static XMLStreamException unexpectedElement ( final XMLExtendedStreamReader reader ) { } private static XMLStreamException invalidAttributeValue ( final XMLExtendedStreamReader reader , final int index ) { } private static XMLStreamException missingRequired ( final XMLExtendedStreamReader reader , final Set < ? > required ) { } static LoggingSubsystemElement parseLoggingSubsystemElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { if ( ( reader . getAttributeCount ( ) ) > 0 ) { throw LoggingSubsystemParser . unexpectedAttribute ( reader , 0 ) ; } <START_BUG> final LoggingSubsystemElement subsystemElement = new LoggingSubsystemElement ( null , reader . getName ( ) ) ; <END_BUG> final EnumSet < Element > encountered = EnumSet . noneOf ( Element . class ) ; while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) ) { switch ( Namespace . forUri ( reader . getNamespaceURI ( ) ) ) { case LOGGING_1_0 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( encountered . contains ( element ) ) { throw LoggingSubsystemParser . duplicateNamedElement ( reader , reader . getLocalName ( ) ) ; } encountered . add ( element ) ; switch ( element ) { case LOGGER : { LoggerElement loggerElement = LoggingSubsystemParser . parseLoggerElement ( reader ) ; subsystemElement . addLogger ( loggerElement . getName ( ) , loggerElement ) ; break ; } case ROOT_LOGGER : { RootLoggerElement loggerElement = LoggingSubsystemParser . parseRootLoggerElement ( reader ) ; subsystemElement . addLogger ( "" , loggerElement ) ; break ; } case CONSOLE_HANDLER : { ConsoleHandlerElement handlerElement = LoggingSubsystemParser . parseConsoleHandlerElement ( reader ) ; subsystemElement . addHandler ( handlerElement . getName ( ) , handlerElement ) ; break ; } case FILE_HANDLER : { FileHandlerElement handlerElement = LoggingSubsystemParser . parseFileHandlerElement ( reader ) ; subsystemElement . addHandler ( handlerElement . getName ( ) , handlerElement ) ; break ; } case PERIODIC_ROTATING_FILE_HANDLER : { PeriodicRotatingFileHandlerElement handlerElement = LoggingSubsystemParser . parsePeriodicRotatingFileHandlerElement ( reader ) ; subsystemElement . addHandler ( handlerElement . getName ( ) , handlerElement ) ; break ; } case SIZE_ROTATING_FILE_HANDLER : { SizeRotatingFileHandlerElement handlerElement = LoggingSubsystemParser . parseSizeRotatingHandlerElement ( reader ) ; subsystemElement . addHandler ( handlerElement . getName ( ) , handlerElement ) ; break ; } case ASYNC_HANDLER : { AsyncHandlerElement handlerElement = LoggingSubsystemParser . parseAsyncHandlerElement ( reader ) ; subsystemElement . addHandler ( handlerElement . getName ( ) , handlerElement ) ; break ; } default : { final ParseResult < AbstractHandlerElement < ? > > result = new ParseResult < AbstractHandlerElement < ? > > ( ) ; reader . handleAny ( result ) ; AbstractHandlerElement < ? > handlerElement = result . getResult ( ) ; subsystemElement . addHandler ( handlerElement . getName ( ) , handlerElement ) ; break ; } } break ; } default : { throw LoggingSubsystemParser . unexpectedElement ( reader ) ; } } } return subsystemElement ; } private static LoggerElement parseLoggerElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static Level parseLevelElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static RootLoggerElement parseRootLoggerElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static void readHandlerChildren ( final AbstractHandlerElement < ? > handlerElement , final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static PropertiesElement parsePropertiesElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static AbstractFormatterElement < ? > parseFormatterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static PatternFormatterElement parsePatternFormatterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static ConsoleHandlerElement parseConsoleHandlerElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FileHandlerElement parseFileHandlerElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static PeriodicRotatingFileHandlerElement parsePeriodicRotatingFileHandlerElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static SizeRotatingFileHandlerElement parseSizeRotatingHandlerElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static final Pattern SIZE_PATTERN = Pattern . compile ( "(\\d+)([kKmMgGbBtT])?" ) ; private static long parseSize ( final String value ) { } private static AsyncHandlerElement parseAsyncHandlerElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterElement parseFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseSimpleFilter ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseChangeLevelFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseLevelRangeFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseLevelFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseReplaceFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseMatchFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseNotFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseAcceptFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static FilterType parseDenyFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static AllFilterType parseAllFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static AnyFilterType parseAnyFilterElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static List < String > parseHandlersElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } private static String parseRefElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } }

Fix:
final LoggingSubsystemElement subsystemElement = new LoggingSubsystemElement ( reader . getName ( ) ) ;