Program: 88664
Project: 88664
Buggy source:
private ValidationRuleViolation valueDiff(Slot e,JSONObject info){
  Debug.outln("String_Node_Str" + Utils.slotValueToString(e) + "String_Node_Str"+ info);
  List<ValueSpecification> vs=e.getValue();
  String valueTypes=(String)info.get("String_Node_Str");
  JSONArray value=(JSONArray)info.get("String_Node_Str");
  Debug.outln("String_Node_Str" + value);
  boolean nullElementValues=areNullElementValues(vs);
  if ((vs == null || vs.isEmpty() || nullElementValues) && (valueTypes == null || value == null || value.size() == 0)) {
    Debug.outln("String_Node_Str" + vs + "String_Node_Str"+ valueTypes+ "String_Node_Str"+ value);
    return null;
  }
  if (vs != null && vs.size() > 0 && !nullElementValues && (valueTypes == null || value == null || value.size() == 0)) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str");
    v.addAction(new ImportValue(e,null,null,result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  if ((vs == null || vs.isEmpty() || nullElementValues) && value != null && value.size() > 0 && valueTypes != null) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str" + truncate(value.toString()));
    v.addAction(new ImportValue(e,value,PropertyValueType.valueOf(valueTypes),result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  if ((vs.size() != value.size())) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str");
    v.addAction(new ImportValue(e,value,PropertyValueType.valueOf(valueTypes),result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  PropertyValueType valueType=PropertyValueType.valueOf(valueTypes);
  String message="String_Node_Str";
  String typeMismatchMessage="String_Node_Str";
  String badMessage="String_Node_Str" + truncate(RepresentationTextCreator.getRepresentedText(e)) + "String_Node_Str"+ truncate(value.toString());
  if (valueType == PropertyValueType.LiteralString) {
    if (vs.get(0) instanceof LiteralString) {
      for (int i=0; i < vs.size(); i++) {
        String modelString=Utils.stripHtmlWrapper(((LiteralString)vs.get(i)).getValue()).replace("String_Node_Str","String_Node_Str");
        String webString=((String)value.get(i)).replace("String_Node_Str","String_Node_Str");
        value.set(i,webString);
        if (!modelString.equals(webString)) {
          message=badMessage;
          break;
        }
      }
    }
 else {
      message=typeMismatchMessage;
    }
  }
 else   if (valueType == PropertyValueType.LiteralBoolean) {
    if (vs.get(0) instanceof LiteralBoolean) {
      for (int i=0; i < vs.size(); i++) {
        if (((Boolean)value.get(i)) != (((LiteralBoolean)vs.get(i)).isValue())) {
          message=badMessage;
          break;
        }
      }
    }
 else {
      message=typeMismatchMessage;
    }
  }
 else   if (valueType == PropertyValueType.LiteralInteger) {
    if (vs.get(0) instanceof LiteralInteger) {
      for (int i=0; i < vs.size(); i++) {
        if (((LiteralInteger)vs.get(i)).getValue() != ((Long)value.get(i)).intValue()) {
          message=badMessage;
          break;
        }
      }
    }
 else     if (vs.get(0) instanceof LiteralUnlimitedNatural) {
      for (int i=0; i < vs.size(); i++) {
        if (((LiteralUnlimitedNatural)vs.get(i)).getValue() != ((Long)value.get(i)).intValue()) {
          message=badMessage;
          valueType=PropertyValueType.LiteralUnlimitedNatural;
          break;
        }
      }
    }
 else {
      message="String_Node_Str";
    }
  }
 else   if (valueType == PropertyValueType.LiteralReal) {
    if (vs.get(0) instanceof LiteralReal) {
      for (int i=0; i < vs.size(); i++) {
        Double webValue=null;
        if (value.get(i) instanceof Long)         webValue=Double.parseDouble(((Long)value.get(i)).toString());
 else         webValue=(Double)value.get(i);
        if (((LiteralReal)vs.get(i)).getValue() != webValue) {
          message=badMessage;
          break;
        }
      }
    }
 else {
      message=typeMismatchMessage;
    }
  }
 else   if (valueType == PropertyValueType.ElementValue) {
    if (vs.get(0) instanceof ElementValue) {
      for (int i=0; i < vs.size(); i++) {
        if (((ElementValue)vs.get(i)).getElement() == null || !((ElementValue)vs.get(i)).getElement().getID().equals(value.get(i))) {
          message=badMessage;
          break;
        }
      }
    }
 else     message=typeMismatchMessage;
  }
 else   if (valueType == PropertyValueType.Expression) {
  }
 else {
  }
  if (!message.equals("String_Node_Str")) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,message);
    v.addAction(new ImportValue(e,value,valueType,result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  Debug.outln("String_Node_Str");
  return null;
}

Fixed version (ground truth):
private ValidationRuleViolation valueDiff(Slot e,JSONObject info){
  Debug.outln("String_Node_Str" + Utils.slotValueToString(e) + "String_Node_Str"+ info);
  List<ValueSpecification> vs=e.getValue();
  String valueTypes=(String)info.get("String_Node_Str");
  JSONArray value=(JSONArray)info.get("String_Node_Str");
  Debug.outln("String_Node_Str" + value);
  boolean nullElementValues=areNullElementValues(vs);
  if ((vs == null || vs.isEmpty() || nullElementValues) && (valueTypes == null || value == null || value.size() == 0)) {
    Debug.outln("String_Node_Str" + vs + "String_Node_Str"+ valueTypes+ "String_Node_Str"+ value);
    return null;
  }
  if (vs != null && vs.size() > 0 && !nullElementValues && (valueTypes == null || value == null || value.size() == 0)) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str");
    v.addAction(new ImportValue(e,null,null,result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  if ((vs == null || vs.isEmpty() || nullElementValues) && value != null && value.size() > 0 && valueTypes != null) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str" + truncate(value.toString()));
    v.addAction(new ImportValue(e,value,PropertyValueType.valueOf(valueTypes),result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  if ((vs.size() != value.size())) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str");
    v.addAction(new ImportValue(e,value,PropertyValueType.valueOf(valueTypes),result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  PropertyValueType valueType=PropertyValueType.valueOf(valueTypes);
  String message="String_Node_Str";
  String typeMismatchMessage="String_Node_Str";
  String badMessage="String_Node_Str" + truncate(RepresentationTextCreator.getRepresentedText(e)) + "String_Node_Str"+ truncate(value.toString());
  if (valueType == PropertyValueType.LiteralString) {
    if (vs.get(0) instanceof LiteralString) {
      for (int i=0; i < vs.size(); i++) {
        String modelString=Utils.stripHtmlWrapper(((LiteralString)vs.get(i)).getValue()).replace("String_Node_Str","String_Node_Str");
        String webString=((String)value.get(i)).replace("String_Node_Str","String_Node_Str");
        value.set(i,webString);
        if (!modelString.equals(webString)) {
          message=badMessage;
          break;
        }
      }
    }
 else {
      message=typeMismatchMessage;
    }
  }
 else   if (valueType == PropertyValueType.LiteralBoolean) {
    if (vs.get(0) instanceof LiteralBoolean) {
      for (int i=0; i < vs.size(); i++) {
        if (((Boolean)value.get(i)) != (((LiteralBoolean)vs.get(i)).isValue())) {
          message=badMessage;
          break;
        }
      }
    }
 else {
      message=typeMismatchMessage;
    }
  }
 else   if (valueType == PropertyValueType.LiteralInteger) {
    if (vs.get(0) instanceof LiteralInteger) {
      for (int i=0; i < vs.size(); i++) {
        if (((LiteralInteger)vs.get(i)).getValue() != ((Long)value.get(i)).intValue()) {
          message=badMessage;
          break;
        }
      }
    }
 else     if (vs.get(0) instanceof LiteralUnlimitedNatural) {
      for (int i=0; i < vs.size(); i++) {
        if (((LiteralUnlimitedNatural)vs.get(i)).getValue() != ((Long)value.get(i)).intValue()) {
          message=badMessage;
          valueType=PropertyValueType.LiteralUnlimitedNatural;
          break;
        }
      }
    }
 else {
      message="String_Node_Str";
    }
  }
 else   if (valueType == PropertyValueType.LiteralReal) {
    if (vs.get(0) instanceof LiteralReal) {
      for (int i=0; i < vs.size(); i++) {
        Double webValue=null;
        if (value.get(i) instanceof Long)         webValue=Double.parseDouble(((Long)value.get(i)).toString());
 else         webValue=(Double)value.get(i);
        if (((LiteralReal)vs.get(i)).getValue() != webValue) {
          message=badMessage;
          break;
        }
      }
    }
 else {
      message=typeMismatchMessage;
    }
  }
 else   if (valueType == PropertyValueType.ElementValue) {
    if (vs.get(0) instanceof ElementValue) {
      for (int i=0; i < vs.size(); i++) {
        if (((ElementValue)vs.get(i)).getElement() == null || !ExportUtility.getElementID(((ElementValue)vs.get(i)).getElement()).equals(value.get(i))) {
          message=badMessage;
          break;
        }
      }
    }
 else     if (vs.get(0) instanceof InstanceValue) {
      for (int i=0; i < vs.size(); i++) {
        if (((InstanceValue)vs.get(i)).getInstance() == null || !ExportUtility.getElementID(((InstanceValue)vs.get(i)).getInstance()).equals(value.get(i))) {
          message=badMessage;
          break;
        }
      }
    }
 else     message=typeMismatchMessage;
  }
 else   if (valueType == PropertyValueType.Expression) {
  }
 else {
  }
  if (!message.equals("String_Node_Str")) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,message);
    v.addAction(new ImportValue(e,value,valueType,result));
    v.addAction(new ExportValue(e));
    Debug.outln("String_Node_Str" + v);
    return v;
  }
  Debug.outln("String_Node_Str");
  return null;
}