Buggy code:
public class DsParser extends AbstractParser { private static CommonBundle bundle = Messages . getBundle ( CommonBundle . class ) ; public void parse ( final XMLExtendedStreamReader reader , final List < ModelNode > list , ModelNode parentAddress ) throws Exception { } private void parseDataSources ( final XMLExtendedStreamReader reader , final List < ModelNode > list , final ModelNode parentAddress ) throws XMLStreamException , ParserException , ValidateException { } private void parseDriver ( final XMLExtendedStreamReader reader , final List < ModelNode > list , final ModelNode parentAddress ) throws XMLStreamException , ParserException , ValidateException { } private void parseXADataSource ( XMLExtendedStreamReader reader , final List < ModelNode > list , final ModelNode parentAddress ) throws XMLStreamException , ParserException , ValidateException { } private void parseDsSecurity ( XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException , ParserException , ValidateException { } private void parseDataSource ( final XMLExtendedStreamReader reader , final List < ModelNode > list , final ModelNode parentAddress ) throws XMLStreamException , ParserException , ValidateException { String poolName = null ; final ModelNode operation = new ModelNode ( ) ; operation . get ( OP ) . set ( ADD ) ; boolean enabled = ENABLED . booleanValue ( ) ; <START_BUG> boolean persistEnabled = false ; <END_BUG> for ( DataSource . Attribute attribute : Attribute . values ( ) ) { switch ( attribute ) { case Constants . ENABLED : { String value = rawAttributeText ( reader , Constants . ENABLED . getXmlName ( ) ) ; if ( value != null ) { enabled = Boolean . parseBoolean ( value ) ; persistEnabled = true ; } break ; } case JNDI_NAME : { final String jndiName = rawAttributeText ( reader , Constants . JNDINAME . getXmlName ( ) ) ; Constants . JNDINAME . parseAndSetParameter ( jndiName , operation , reader ) ; break ; } case POOL_NAME : { poolName = rawAttributeText ( reader , Constants . POOLNAME_NAME ) ; break ; } case Constants . USE_JAVA_CONTEXT : { String value = rawAttributeText ( reader , Constants . USE_JAVA_CONTEXT . getXmlName ( ) ) ; if ( value != null ) { Constants . USE_JAVA_CONTEXT . parseAndSetParameter ( value , operation , reader ) ; } break ; } case Constants . SPY : { String value = rawAttributeText ( reader , Constants . SPY . getXmlName ( ) ) ; if ( value != null ) { Constants . SPY . parseAndSetParameter ( value , operation , reader ) ; } break ; } case Constants . USE_CCM : { String value = rawAttributeText ( reader , Constants . USE_CCM . getXmlName ( ) ) ; if ( value != null ) { Constants . USE_CCM . parseAndSetParameter ( value , operation , reader ) ; } break ; } case Constants . JTA : { String value = rawAttributeText ( reader , Constants . JTA . getXmlName ( ) ) ; if ( value != null ) { Constants . JTA . parseAndSetParameter ( value , operation , reader ) ; } break ; } default : break ; } } final ModelNode dsAddress = parentAddress . clone ( ) ; dsAddress . add ( Constants . DATA_SOURCE , poolName ) ; dsAddress . protect ( ) ; operation . get ( OP_ADDR ) . set ( dsAddress ) ; List < ModelNode > configPropertiesOperations = new ArrayList < ModelNode > ( 0 ) ; while ( reader . hasNext ( ) ) { switch ( reader . nextTag ( ) ) { case XMLStreamConstants . END_ELEMENT : { if ( ( DataSources . Tag . forName ( reader . getLocalName ( ) ) ) == ( DataSources . Tag . DATASOURCE ) ) { list . add ( operation ) ; list . addAll ( configPropertiesOperations ) ; if ( enabled ) { final ModelNode enableOperation = new ModelNode ( ) ; enableOperation . get ( OP ) . set ( ENABLE ) ; enableOperation . get ( OP_ADDR ) . set ( dsAddress ) ; enableOperation . get ( PERSISTENT ) . set ( persistEnabled ) ; list . add ( enableOperation ) ; } return ; } else { if ( ( DataSource . Tag . forName ( reader . getLocalName ( ) ) ) == ( DataSource . Tag . UNKNOWN ) ) { throw new ParserException ( DsParser . bundle . unexpectedEndTag ( reader . getLocalName ( ) ) ) ; } } break ; } case XMLStreamConstants . START_ELEMENT : { switch ( DataSource . Tag . forName ( reader . getLocalName ( ) ) ) { case CONNECTION_PROPERTY : { String name = rawAttributeText ( reader , "name" ) ; String value = rawElementText ( reader ) ; final ModelNode configOperation = new ModelNode ( ) ; configOperation . get ( OP ) . set ( ADD ) ; final ModelNode configAddress = dsAddress . clone ( ) ; configAddress . add ( Constants . CONNECTION_PROPERTIES . getName ( ) , name ) ; configAddress . protect ( ) ; configOperation . get ( OP_ADDR ) . set ( configAddress ) ; Constants . CONNECTION_PROPERTY_VALUE . parseAndSetParameter ( value , configOperation , reader ) ; configPropertiesOperations . add ( configOperation ) ; break ; } case Constants . CONNECTION_URL : { String value = rawElementText ( reader ) ; Constants . CONNECTION_URL . parseAndSetParameter ( value , operation , reader ) ; break ; } case Constants . DRIVER_CLASS : { String value = rawElementText ( reader ) ; Constants . DRIVER_CLASS . parseAndSetParameter ( value , operation , reader ) ; break ; } case Constants . DATASOURCE_CLASS : { String value = rawElementText ( reader ) ; Constants . DATASOURCE_CLASS . parseAndSetParameter ( value , operation , reader ) ; break ; } case DRIVER : { String value = rawElementText ( reader ) ; Constants . DATASOURCE_DRIVER . parseAndSetParameter ( value , operation , reader ) ; break ; }

Fix:
boolean persistEnabled = true ;