Program: 66855
Project: 66855
Buggy source:
/** 
 * @return
 * @throws SemanticException
 */
private boolean modifyJointCondition() throws SemanticException {
  JointDataSetHandle handle=null;
  if (leftDataSetName == null || rightDataSetName == null)   return false;
  if (propertyPageContainer instanceof DataSetEditor) {
    boolean selectionChanged=true;
    handle=(JointDataSetHandle)((DataSetEditor)propertyPageContainer).getModel();
    Iterator iter=handle.getPropertyHandle(JointDataSet.JOIN_CONDITONS_PROP).iterator();
    while (iter.hasNext()) {
      JoinConditionHandle condition=(JoinConditionHandle)iter.next();
      if ((condition.getLeftDataSet() != null && condition.getLeftDataSet().equals(this.leftDataSetName)) && (condition.getLeftDataSet() != null && condition.getRightDataSet().equals(this.rightDataSetName))) {
        selectionChanged=false;
      }
    }
    if (selectionChanged) {
      List datasetName=handle.getDataSetNames();
      for (int i=0; i < datasetName.size(); i++) {
        try {
          handle.removeDataSet((String)datasetName.get(i));
        }
 catch (        SemanticException e) {
        }
      }
      if (leftDataSetName.equals(rightDataSetName))       handle.addDataSet(leftDataSetName);
 else {
        handle.addDataSet(leftDataSetName);
        handle.addDataSet(rightDataSetName);
      }
      setParameters(handle);
      addColumnHints(handle);
      if (propertyHandle != null) {
        JoinCondition condition=createJoinCondition();
        propertyHandle.removeItem(0);
        propertyHandle.addItem(condition);
        return true;
      }
 else       return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws SemanticException
 */
private boolean modifyJointCondition() throws SemanticException {
  JointDataSetHandle handle=null;
  if (leftDataSetName == null || rightDataSetName == null)   return false;
  if (propertyPageContainer instanceof DataSetEditor) {
    boolean selectionChanged=true;
    handle=(JointDataSetHandle)((DataSetEditor)propertyPageContainer).getModel();
    Iterator iter=handle.getPropertyHandle(JointDataSet.JOIN_CONDITONS_PROP).iterator();
    JoinConditionHandle conditionHandle;
    while (iter.hasNext()) {
      conditionHandle=(JoinConditionHandle)iter.next();
      if ((conditionHandle.getLeftDataSet() != null && conditionHandle.getLeftDataSet().equals(this.leftDataSetName)) && (conditionHandle.getLeftDataSet() != null && conditionHandle.getRightDataSet().equals(this.rightDataSetName))) {
        selectionChanged=false;
        conditionHandle.setJoinType(joinType);
      }
    }
    if (selectionChanged) {
      List datasetName=handle.getDataSetNames();
      for (int i=0; i < datasetName.size(); i++) {
        try {
          handle.removeDataSet((String)datasetName.get(i));
        }
 catch (        SemanticException e) {
        }
      }
      if (leftDataSetName.equals(rightDataSetName))       handle.addDataSet(leftDataSetName);
 else {
        handle.addDataSet(leftDataSetName);
        handle.addDataSet(rightDataSetName);
      }
      setParameters(handle);
      addColumnHints(handle);
      if (propertyHandle != null) {
        JoinCondition condition=createJoinCondition();
        propertyHandle.removeItem(0);
        propertyHandle.addItem(condition);
        return true;
      }
 else       return false;
    }
  }
  return true;
}