Program: 88612
Project: 88612
Buggy source:
private void checkElement(Element e,JSONObject elementInfo){
  String elementID=ExportUtility.getElementID(e);
  String elementDoc=ModelHelper.getComment(e);
  String elementDocClean=ExportUtility.cleanHtml(elementDoc);
  String elementName=null;
  Boolean editable=(Boolean)elementInfo.get("String_Node_Str");
  String webDoc=(String)elementInfo.get("String_Node_Str");
  DetailDiff ddiff=new DetailDiff(e,elementInfo);
  if (webDoc != null) {
    webDoc=ExportUtility.cleanHtml(webDoc);
    elementInfo.put("String_Node_Str",webDoc);
  }
  if (e instanceof NamedElement) {
    elementName=((NamedElement)e).getName();
  }
  String webName=ExportUtility.unescapeHtml((String)elementInfo.get("String_Node_Str"));
  if (elementName != null && !elementName.equals(webName)) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str" + elementName + "String_Node_Str"+ webName);
    differentElements.add(elementID);
    if (editable)     v.addAction(new ExportName((NamedElement)e));
    v.addAction(ddiff);
    v.addAction(new ImportName((NamedElement)e,webName,result));
    nameDiff.addViolation(v);
  }
  if (elementDoc != null && !(webDoc == null && elementDoc.equals("String_Node_Str")) && !elementDocClean.equals(webDoc)) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str" + truncate(elementDocClean) + "String_Node_Str"+ truncate((String)elementInfo.get("String_Node_Str")));
    differentElements.add(elementID);
    if (editable)     v.addAction(new ExportDoc(e));
    v.addAction(new CompareText(e,webDoc,elementDocClean,result));
    v.addAction(ddiff);
    v.addAction(new ImportDoc(e,webDoc,result));
    docDiff.addViolation(v);
  }
  if (e instanceof Property) {
    ValidationRuleViolation v=valueDiff((Property)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      valueDiff.addViolation(v);
      differentElements.add(elementID);
    }
    ValidationRuleViolation v2=propertyDiff((Property)e,elementInfo);
    if (v2 != null) {
      v2.getActions().add(v2.getActions().size() > 1 ? 1 : 0,ddiff);
      propertyTypeDiff.addViolation(v2);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Slot) {
    ValidationRuleViolation v=valueDiff((Slot)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      valueDiff.addViolation(v);
      differentElements.add(elementID);
    }
    ValidationRuleViolation v2=slotTypeDiff((Slot)e,elementInfo);
    if (v2 != null) {
      v2.getActions().add(v2.getActions().size() > 1 ? 1 : 0,ddiff);
      propertyTypeDiff.addViolation(v2);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Comment) {
  }
 else   if (e instanceof DirectedRelationship) {
    ValidationRuleViolation v=relationshipDiff((DirectedRelationship)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      relDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Connector) {
    ValidationRuleViolation v=connectorDiff((Connector)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      connectorDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Constraint) {
    ValidationRuleViolation v=constraintDiff((Constraint)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      constraintDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Operation) {
    ValidationRuleViolation v=operationDiff((Operation)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      operationDiff.addViolation(v);
      differentElements.add(e);
    }
  }
 else   if (e instanceof Parameter) {
    ValidationRuleViolation v=parameterDiff((Parameter)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      parameterDiff.addViolation(v);
      differentElements.add(e);
    }
  }
 else   if (e instanceof Association) {
    ValidationRuleViolation v=associationDiff((Association)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      associationDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Package) {
    ValidationRuleViolation v=siteDiff((Package)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      siteDiff.addViolation(v);
    }
  }
 else   if (e instanceof InstanceSpecification) {
    ValidationRuleViolation v=instanceSpecificationDiff((InstanceSpecification)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      instanceSpec.addViolation(v);
      differentElements.add(elementID);
    }
  }
  if (e instanceof Class) {
    ValidationRuleViolation v=ownedAttributeDiff((Class)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      ownedAttribute.addViolation(v);
      differentElements.add(elementID);
    }
  }
  ValidationRuleViolation v=ownerDiff(e,elementInfo);
  if (v != null) {
    v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
    ownership.addViolation(v);
    differentElements.add(elementID);
  }
  v=metatypeDiff(e,elementInfo);
  if (v != null) {
    v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
    metatypes.addViolation(v);
    differentElements.add(elementID);
  }
  docDiff(e,elementInfo);
}

Fixed version (ground truth):
private void checkElement(Element e,JSONObject elementInfo){
  String elementID=ExportUtility.getElementID(e);
  String elementDoc=ModelHelper.getComment(e);
  String elementDocClean=ExportUtility.cleanHtml(elementDoc);
  String elementName=null;
  Boolean editable=(Boolean)elementInfo.get("String_Node_Str");
  String webDoc=(String)elementInfo.get("String_Node_Str");
  DetailDiff ddiff=new DetailDiff(e,elementInfo);
  if (webDoc != null) {
    webDoc=ExportUtility.cleanHtml(webDoc);
    elementInfo.put("String_Node_Str",webDoc);
  }
  if (e instanceof NamedElement) {
    elementName=((NamedElement)e).getName();
  }
  String webName=ExportUtility.unescapeHtml((String)elementInfo.get("String_Node_Str"));
  if (elementName != null && !elementName.equals(webName)) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str" + elementName + "String_Node_Str"+ webName);
    differentElements.add(elementID);
    if (editable)     v.addAction(new ExportName((NamedElement)e));
    v.addAction(ddiff);
    v.addAction(new ImportName((NamedElement)e,webName,result));
    nameDiff.addViolation(v);
  }
  if (elementDoc != null && !(webDoc == null && elementDoc.equals("String_Node_Str")) && !elementDocClean.equals(webDoc)) {
    ValidationRuleViolation v=new ValidationRuleViolation(e,"String_Node_Str" + truncate(elementDocClean) + "String_Node_Str"+ truncate((String)elementInfo.get("String_Node_Str")));
    differentElements.add(elementID);
    if (editable)     v.addAction(new ExportDoc(e));
    v.addAction(new CompareText(e,webDoc,elementDocClean,result));
    v.addAction(ddiff);
    v.addAction(new ImportDoc(e,webDoc,result));
    docDiff.addViolation(v);
  }
  if (e instanceof Property) {
    ValidationRuleViolation v=valueDiff((Property)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      valueDiff.addViolation(v);
      differentElements.add(elementID);
    }
    ValidationRuleViolation v2=propertyDiff((Property)e,elementInfo);
    if (v2 != null) {
      v2.getActions().add(v2.getActions().size() > 1 ? 1 : 0,ddiff);
      propertyTypeDiff.addViolation(v2);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Slot) {
    ValidationRuleViolation v=valueDiff((Slot)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      valueDiff.addViolation(v);
      differentElements.add(elementID);
    }
    ValidationRuleViolation v2=slotTypeDiff((Slot)e,elementInfo);
    if (v2 != null) {
      v2.getActions().add(v2.getActions().size() > 1 ? 1 : 0,ddiff);
      propertyTypeDiff.addViolation(v2);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Comment) {
  }
 else   if (e instanceof DirectedRelationship) {
    ValidationRuleViolation v=relationshipDiff((DirectedRelationship)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      relDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Connector) {
    ValidationRuleViolation v=connectorDiff((Connector)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      connectorDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Constraint) {
    ValidationRuleViolation v=constraintDiff((Constraint)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      constraintDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Operation) {
    ValidationRuleViolation v=operationDiff((Operation)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      operationDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Parameter) {
    ValidationRuleViolation v=parameterDiff((Parameter)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      parameterDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Association) {
    ValidationRuleViolation v=associationDiff((Association)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      associationDiff.addViolation(v);
      differentElements.add(elementID);
    }
  }
 else   if (e instanceof Package) {
    ValidationRuleViolation v=siteDiff((Package)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      siteDiff.addViolation(v);
    }
  }
 else   if (e instanceof InstanceSpecification) {
    ValidationRuleViolation v=instanceSpecificationDiff((InstanceSpecification)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      instanceSpec.addViolation(v);
      differentElements.add(elementID);
    }
  }
  if (e instanceof Class) {
    ValidationRuleViolation v=ownedAttributeDiff((Class)e,elementInfo);
    if (v != null) {
      v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
      ownedAttribute.addViolation(v);
      differentElements.add(elementID);
    }
  }
  ValidationRuleViolation v=ownerDiff(e,elementInfo);
  if (v != null) {
    v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
    ownership.addViolation(v);
    differentElements.add(elementID);
  }
  v=metatypeDiff(e,elementInfo);
  if (v != null) {
    v.getActions().add(v.getActions().size() > 1 ? 1 : 0,ddiff);
    metatypes.addViolation(v);
    differentElements.add(elementID);
  }
  docDiff(e,elementInfo);
}