Buggy code:
private final String xmlName ; private final ModelType type ; private final boolean allowNull ; private final boolean allowExpression ; private final ModelNode defaultValue ; private final MeasurementUnit measurementUnit ; private final String [ ] alternatives ; private final String [ ] requires ; private final ParameterCorrector valueCorrector ; private final ParameterValidator validator ; private final EnumSet < AttributeAccess . Flag > flags ; protected final AttributeMarshaller attributeMarshaller ; private final boolean resourceOnly ; private final DeprecationData deprecationData ; protected AttributeDefinition ( String name , String xmlName , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final boolean allowExpression , final MeasurementUnit measurementUnit , final ParameterValidator validator , final String [ ] alternatives , final String [ ] requires , final AttributeAccess ... flags ) { } protected AttributeDefinition ( String name , String xmlName , final ModelNode defaultValue , final ModelType type , final boolean allowNull , final boolean allowExpression , final MeasurementUnit measurementUnit , final ParameterCorrector valueCorrector , final ParameterValidator validator , boolean validateNull , final String [ ] alternatives , final String [ ] requires , AttributeMarshaller attributeMarshaller , boolean resourceOnly , DeprecationData deprecationData , final AttributeAccess ... flags ) { } public String getName ( ) { } public String getXmlName ( ) { } public ModelType getType ( ) { } public boolean isAllowNull ( ) { } public boolean isAllowExpression ( ) { } public ModelNode getDefaultValue ( ) { } public MeasurementUnit getMeasurementUnit ( ) { } public ParameterValidator getValidator ( ) { } public String [ ] getAlternatives ( ) { } public String [ ] getRequires ( ) { } public EnumSet < AttributeAccess . Flag > getFlags ( ) { } public boolean isMarshallable ( final ModelNode resourceModel ) { } public boolean isMarshallable ( final ModelNode resourceModel , final boolean marshallDefault ) { } public ModelNode validateOperation ( final ModelNode operationObject ) throws OperationFailedException { } public final void validateAndSet ( ModelNode operationObject , final ModelNode model ) throws OperationFailedException { } @ Deprecated public ModelNode validateResolvedOperation ( final ModelNode operationObject ) throws OperationFailedException { } public ModelNode resolveModelAttribute ( final OperationContext context , final ModelNode model ) throws OperationFailedException { } public ModelNode resolveModelAttribute ( final ExpressionResolver resolver , final ModelNode model ) throws OperationFailedException { } public boolean isAllowed ( final ModelNode operationObject ) { } public boolean isRequired ( final ModelNode operationObject ) { } public boolean hasAlternative ( final ModelNode operationObject ) { } 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 { } public ModelNode addResourceAttributeDescription ( final ResourceBundle bundle , final String prefix , final ModelNode resourceDescription ) { } public ModelNode addResourceAttributeDescription ( final ModelNode resourceDescription , final ResourceDescriptionResolver resolver , final Locale locale , final ResourceBundle bundle ) { } public ModelNode addOperationParameterDescription ( final ResourceBundle bundle , final String prefix , final ModelNode operationDescription ) { } public ModelNode addOperationParameterDescription ( final ModelNode resourceDescription , final String operationName , final ResourceDescriptionResolver resolver , final Locale locale , final ResourceBundle bundle ) { } public String getAttributeTextDescription ( final ResourceBundle bundle , final String prefix ) { } public String getAttributeDeprecatedDescription ( final ResourceBundle bundle , final String prefix ) { } public ModelNode addDeprecatedInfo ( final ModelNode model ) { } public ModelNode getNoTextDescription ( boolean forOperation ) { final ModelNode result = new ModelNode ( ) ; result . get ( TYPE ) . set ( type ) ; result . get ( DESCRIPTION ) ; result . get ( EXPRESSIONS_ALLOWED ) . set ( isAllowExpression ( ) ) ; if ( forOperation ) { result . get ( REQUIRED ) . set ( ( ! ( isAllowNull ( ) ) ) ) ; } result . get ( NILLABLE ) . set ( isAllowNull ( ) ) ; <START_BUG> if ( ( ( ! forOperation ) && ( ( defaultValue ) != null ) ) && ( defaultValue . isDefined ( ) ) ) { <END_BUG> result . get ( DEFAULT ) . set ( defaultValue ) ; } if ( ( ( measurementUnit ) != null ) && ( ( measurementUnit ) != ( MeasurementUnit . NONE ) ) ) { result . get ( UNIT ) . set ( measurementUnit . getName ( ) ) ; } if ( ( alternatives ) != null ) { for ( final String alternative : alternatives ) { result . get ( ALTERNATIVES ) . add ( alternative ) ; } } if ( ( requires ) != null ) { for ( final String required : requires ) { result . get ( REQUIRES ) . add ( required ) ; } } if ( ( validator ) instanceof MinMaxValidator ) { MinMaxValidator minMax = ( ( MinMaxValidator ) ( validator ) ) ; Long min = minMax . getMin ( ) ; if ( min != null ) { switch ( this . type ) { case STRING : case LIST : case OBJECT : case BYTES : result . get ( MIN_LENGTH ) . set ( min ) ; break ; default : result . get ( MIN ) . set ( min ) ; } } Long max = minMax . getMax ( ) ; if ( max != null ) { switch ( this . type ) { case STRING : case LIST : case OBJECT : case BYTES : result . get ( MAX_LENGTH ) . set ( max ) ; break ; default : result . get ( MAX ) . set ( max ) ; } } } if ( ( validator ) instanceof AllowedValuesValidator ) { AllowedValuesValidator avv = ( ( AllowedValuesValidator ) ( validator ) ) ; List < ModelNode > allowed = avv . getAllowedValues ( ) ;

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