Program: 69050
Project: 69050
Buggy source:
private void addColumnHints(JointDataSetHandle dsHandle) throws SemanticException {
  columnHintHandle=dsHandle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
  if (columnHintHandle == null)   return;
  columnHintHandle.clearValue();
  List<ColumnHint> rightColumns=new ArrayList<ColumnHint>();
  HashMap<String,ColumnHint> resultMap=new HashMap<String,ColumnHint>();
  String leftDsName=this.leftDataSetName;
  String rightDsName=this.rightDataSetName;
  try {
    DataSessionContext context;
    context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,leftHandle.getModuleHandle());
    DataRequestSession session=DataRequestSession.newSession(context);
    IResultMetaData leftMetaData=session.getDataSetMetaData(this.leftDataSetName,false);
    IResultMetaData righMetaData;
    if (this.leftDataSetName != null && this.leftDataSetName.equalsIgnoreCase(this.rightDataSetName)) {
      leftDsName=leftDsName + "String_Node_Str";
      rightDsName=rightDsName + "String_Node_Str";
      righMetaData=leftMetaData;
    }
 else {
      righMetaData=session.getDataSetMetaData(this.rightDataSetName,false);
    }
    for (int i=1; i <= leftMetaData.getColumnCount(); i++) {
      ColumnHint item=createColumnHint(leftMetaData,i,leftDsName);
      resultMap.put((String)item.getProperty(null,ColumnHint.ALIAS_MEMBER),item);
    }
    for (int i=1; i <= righMetaData.getColumnCount(); i++) {
      ColumnHint item=createColumnHint(righMetaData,i,rightDsName);
      rightColumns.add(item);
    }
    session.shutdown();
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
  resetColumnHintAlias(rightColumns,resultMap,leftDsName,rightDsName);
  for (Iterator<ColumnHint> iter=resultMap.values().iterator(); iter.hasNext(); ) {
    ColumnHint item=iter.next();
    if (item != null)     columnHintHandle.addItem(item);
  }
}

Fixed version (ground truth):
private void addColumnHints(JointDataSetHandle dsHandle) throws SemanticException {
  columnHintHandle=dsHandle.getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP);
  if (columnHintHandle == null)   return;
  columnHintHandle.clearValue();
  List<ColumnHint> rightColumns=new ArrayList<ColumnHint>();
  HashMap<String,ColumnHint> resultMap=new HashMap<String,ColumnHint>();
  String leftDsName=this.leftDataSetName;
  String rightDsName=this.rightDataSetName;
  try {
    DataSessionContext context;
    context=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,leftHandle.getModuleHandle());
    DataRequestSession session=DataRequestSession.newSession(context);
    IResultMetaData leftMetaData=session.getDataSetMetaData(leftHandle,false);
    IResultMetaData righMetaData;
    if (this.leftDataSetName != null && this.leftDataSetName.equalsIgnoreCase(this.rightDataSetName)) {
      leftDsName=leftDsName + "String_Node_Str";
      rightDsName=rightDsName + "String_Node_Str";
      righMetaData=leftMetaData;
    }
 else {
      righMetaData=session.getDataSetMetaData(rightHandle,false);
    }
    for (int i=1; i <= leftMetaData.getColumnCount(); i++) {
      ColumnHint item=createColumnHint(leftMetaData,i,leftDsName);
      resultMap.put((String)item.getProperty(null,ColumnHint.ALIAS_MEMBER),item);
    }
    for (int i=1; i <= righMetaData.getColumnCount(); i++) {
      ColumnHint item=createColumnHint(righMetaData,i,rightDsName);
      rightColumns.add(item);
    }
    session.shutdown();
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
  resetColumnHintAlias(rightColumns,resultMap,leftDsName,rightDsName);
  for (Iterator<ColumnHint> iter=resultMap.values().iterator(); iter.hasNext(); ) {
    ColumnHint item=iter.next();
    if (item != null)     columnHintHandle.addItem(item);
  }
}