Buggy code:
public class SimpleAttributeDefinition extends AttributeDefinition { public SimpleAttributeDefinition ( final String name , final ModelType type , final boolean allowNull ) { } public SimpleAttributeDefinition ( final String name , final ModelType type , final boolean allowNull , final MeasurementUnit measurementUnit ) { } public SimpleAttributeDefinition ( final String name , final ModelNode defaultValue , final ModelType type , final boolean allowNull ) { } public SimpleAttributeDefinition ( final String name , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final MeasurementUnit measurementUnit ) { } public SimpleAttributeDefinition ( final String name , final String xmlName , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final boolean allowExpression , final MeasurementUnit measurementUnit ) { } public SimpleAttributeDefinition ( final String name , final String xmlName , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final boolean allowExpression , final MeasurementUnit measurementUnit , final ParameterValidator validator ) { } public SimpleAttributeDefinition ( String name , String xmlName , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final boolean allowExpression , final MeasurementUnit measurementUnit , final ParameterValidator validator , String [ ] alternatives ) { } public SimpleAttributeDefinition ( final String name , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final String [ ] alternatives ) { } private static ParameterValidator createParameterValidator ( final ModelType type , final boolean allowNull , final boolean allowExpression ) { } public ModelNode parse ( final String value , final Location location ) throws XMLStreamException { final String trimmed = ( value == null ) ? null : value . trim ( ) ; ModelNode node ; if ( trimmed != null ) { if ( isAllowExpression ( ) ) { node = ParseUtils . parsePossibleExpression ( trimmed ) ; } else { node = new ModelNode ( ) . set ( trimmed ) ; } if ( ( node . getType ( ) ) != ( ModelType . EXPRESSION ) ) { switch ( getType ( ) ) { case BIG_DECIMAL : node . set ( node . asBigDecimal ( ) ) ; break ; case BIG_INTEGER : node . set ( node . asBigInteger ( ) ) ; break ; case BOOLEAN : node . set ( node . asBoolean ( ) ) ; break ; case BYTES : node . set ( node . asBytes ( ) ) ; break ; case DOUBLE : node . set ( node . asDouble ( ) ) ; break ; case INT : node . set ( node . asInt ( ) ) ; break ; case LONG : node . set ( node . asLong ( ) ) ; break ; } } } else <START_BUG> if ( getDefaultValue ( ) . isDefined ( ) ) { <END_BUG> node = new ModelNode ( ) . set ( getDefaultValue ( ) ) ; } else { node = new ModelNode ( ) ; } try { getValidator ( ) . validateParameter ( getXmlName ( ) , node ) ; } catch ( OperationFailedException e ) { throw new XMLStreamException ( e . getFailureDescription ( ) . toString ( ) , location ) ; } return node ; } public void parseAndSetParameter ( final String value , final ModelNode operation , final Location location ) throws XMLStreamException { } public void marshallAsAttribute ( final ModelNode resourceModel , final XMLStreamWriter writer ) throws XMLStreamException { } public void marshallAsAttribute ( final ModelNode resourceModel , final boolean marshallDefault , final XMLStreamWriter writer ) throws XMLStreamException { } @ Override public void marshallAsElement ( final ModelNode resourceModel , final XMLStreamWriter writer ) throws XMLStreamException { } public void marshallAsElement ( final ModelNode resourceModel , final boolean marshallDefault , final XMLStreamWriter writer ) throws XMLStreamException { } }

Fix:
if ( ( ( getDefaultValue ( ) ) != null ) && ( getDefaultValue ( ) . isDefined ( ) ) ) {