Program: 39142
Project: 39142
Buggy source:
private FieldDefinition getFieldDefinition(final XMLStreamReader reader,final DataDefinitionImpl dataDefinition,final FieldsTag fieldTag) throws XMLStreamException, HookInitializationException, ModelXmlParsingException {
  String fieldType=reader.getLocalName();
  String name=getStringAttribute(reader,"String_Node_Str");
  FieldDefinitionImpl fieldDefinition=new FieldDefinitionImpl(dataDefinition,name);
  fieldDefinition.withReadOnly(getBooleanAttribute(reader,"String_Node_Str",false));
  fieldDefinition.withDefaultValue(getStringAttribute(reader,"String_Node_Str"));
  fieldDefinition.setPersistent(getBooleanAttribute(reader,"String_Node_Str",true));
  fieldDefinition.setExpression(getStringAttribute(reader,"String_Node_Str"));
  FieldType type=getFieldType(reader,dataDefinition,name,fieldTag,fieldType);
  fieldDefinition.withType(type);
  if (getBooleanAttribute(reader,"String_Node_Str",false)) {
    fieldDefinition.withValidator(getValidatorDefinition(reader,new RequiredValidator()));
  }
  if (getBooleanAttribute(reader,"String_Node_Str",false)) {
    fieldDefinition.withValidator(getValidatorDefinition(reader,new UniqueValidator()));
  }
  while (reader.hasNext() && reader.next() > 0) {
    if (isTagEnded(reader,fieldType)) {
      break;
    }
    String tag=getTagStarted(reader);
    if (tag == null) {
      continue;
    }
    addFieldElement(reader,fieldDefinition,type,tag);
  }
  return fieldDefinition;
}

Fixed version (ground truth):
private FieldDefinition getFieldDefinition(final XMLStreamReader reader,final DataDefinitionImpl dataDefinition,final FieldsTag fieldTag) throws XMLStreamException, HookInitializationException, ModelXmlParsingException {
  String fieldType=reader.getLocalName();
  String name=getStringAttribute(reader,"String_Node_Str");
  FieldDefinitionImpl fieldDefinition=new FieldDefinitionImpl(dataDefinition,name);
  fieldDefinition.withReadOnly(getBooleanAttribute(reader,"String_Node_Str",false));
  fieldDefinition.withDefaultValue(getStringAttribute(reader,"String_Node_Str"));
  fieldDefinition.setPersistent(getBooleanAttribute(reader,"String_Node_Str",true));
  fieldDefinition.setExpression(getStringAttribute(reader,"String_Node_Str"));
  FieldType type=getFieldType(reader,dataDefinition,name,fieldTag,fieldType);
  fieldDefinition.withType(type);
  if (getBooleanAttribute(reader,"String_Node_Str",false)) {
    fieldDefinition.withValidator(getValidatorDefinition(reader,new RequiredValidator()));
  }
  if (getBooleanAttribute(reader,"String_Node_Str",false)) {
    fieldDefinition.withValidator(getValidatorDefinition(reader,new UniqueValidator()));
  }
  boolean shouldSetUnscaledValueValidatorMaxValue=true;
  boolean shouldSetScaleValidatorMaxValue=true;
  while (reader.hasNext() && reader.next() > 0) {
    if (isTagEnded(reader,fieldType)) {
      break;
    }
    String tag=getTagStarted(reader);
    if (tag == null) {
      continue;
    }
    FieldHookDefinition fieldHookDefinition=createFieldElement(reader,fieldDefinition,type,tag);
    if (fieldHookDefinition instanceof UnscaledValueValidator) {
      UnscaledValueValidator fieldHook=(UnscaledValueValidator)fieldHookDefinition;
      shouldSetUnscaledValueValidatorMaxValue=fieldHook.getMax() == null;
    }
    if (fieldHookDefinition instanceof ScaleValidator) {
      ScaleValidator fieldHook=(ScaleValidator)fieldHookDefinition;
      shouldSetScaleValidatorMaxValue=fieldHook.getMax() == null;
    }
    fieldDefinition.withValidator(fieldHookDefinition);
  }
  if ("String_Node_Str".equals(fieldType) && shouldSetUnscaledValueValidatorMaxValue) {
    fieldDefinition.withValidator(new UnscaledValueValidator(null,null,Integer.valueOf(7)));
  }
  if ("String_Node_Str".equals(fieldType) && shouldSetScaleValidatorMaxValue) {
    fieldDefinition.withValidator(new ScaleValidator(null,null,Integer.valueOf(5)));
  }
  return fieldDefinition;
}