Program: 65563
Project: 65563
Buggy source:
protected List getModelTargetConnections(){
  List targetjoins=new ArrayList();
  DatasetNodeEditPart datasetEditpart=(DatasetNodeEditPart)getParent();
  TabularCubeHandle cube=datasetEditpart.getCube();
  Iterator iter=cube.joinConditionsIterator();
  while (iter.hasNext()) {
    DimensionConditionHandle condition=(DimensionConditionHandle)iter.next();
    Iterator conditionIter=condition.getJoinConditions().iterator();
    while (conditionIter.hasNext()) {
      DimensionJoinConditionHandle joinCondition=(DimensionJoinConditionHandle)conditionIter.next();
      if (joinCondition.getCubeKey().equals(getColumn().getColumnName())) {
        TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)condition.getHierarchy();
        if (hierarchy == null || hierarchy.getDataSet() == null)         break;
        if (OlapUtil.getDataField(hierarchy.getDataSet(),joinCondition.getHierarchyKey()) != null) {
          List columnList=null;
          try {
            columnList=DataUtil.getColumnList(hierarchy.getDataSet());
          }
 catch (          SemanticException e) {
            ExceptionHandler.handle(e);
          }
          if (columnList != null) {
            for (int i=0; i < columnList.size(); i++) {
              ResultSetColumnHandle resultSetColumn=(ResultSetColumnHandle)columnList.get(i);
              if (resultSetColumn != null && resultSetColumn.getColumnName() != null && resultSetColumn.getColumnName().equals(joinCondition.getHierarchyKey())) {
                targetjoins.add(joinCondition);
                break;
              }
            }
          }
        }
      }
    }
  }
  return targetjoins;
}

Fixed version (ground truth):
protected List getModelTargetConnections(){
  List targetjoins=new ArrayList();
  DatasetNodeEditPart datasetEditpart=(DatasetNodeEditPart)getParent();
  TabularCubeHandle cube=datasetEditpart.getCube();
  Iterator iter=cube.joinConditionsIterator();
  while (iter.hasNext()) {
    DimensionConditionHandle condition=(DimensionConditionHandle)iter.next();
    Iterator conditionIter=condition.getJoinConditions().iterator();
    while (conditionIter.hasNext()) {
      DimensionJoinConditionHandle joinCondition=(DimensionJoinConditionHandle)conditionIter.next();
      if (joinCondition.getCubeKey().equals(getColumn().getColumnName())) {
        TabularHierarchyHandle hierarchy=(TabularHierarchyHandle)condition.getHierarchy();
        if (hierarchy == null || hierarchy.getDataSet() == null)         break;
        if (OlapUtil.getDataField(hierarchy.getDataSet(),joinCondition.getHierarchyKey()) != null) {
          List columnList=new ArrayList();
          TabularLevelHandle[] levels=(TabularLevelHandle[])hierarchy.getContents(IHierarchyModel.LEVELS_PROP).toArray(new TabularLevelHandle[0]);
          if (levels != null) {
            for (int i=0; i < levels.length; i++) {
              ResultSetColumnHandle resultSetColumn=OlapUtil.getDataField(hierarchy.getDataSet(),levels[i].getColumnName());
              if (resultSetColumn != null && !columnList.contains(resultSetColumn))               columnList.add(resultSetColumn);
            }
          }
          for (int i=0; i < columnList.size(); i++) {
            ResultSetColumnHandle resultSetColumn=(ResultSetColumnHandle)columnList.get(i);
            if (resultSetColumn != null && resultSetColumn.getColumnName() != null && resultSetColumn.getColumnName().equals(joinCondition.getHierarchyKey())) {
              targetjoins.add(joinCondition);
              break;
            }
          }
        }
      }
    }
  }
  return targetjoins;
}