Program: 122791
Project: 122791
Buggy source:
private void getFlowToIterateReturns(List<INodeReturn> allReturns){
  List<? extends IConnection> inMainConns=this.getIncomingConnections();
  String inputRowName=null;
  IConnection inMainConn=null;
  if (inMainConns != null && !inMainConns.isEmpty()) {
    inMainConn=inMainConns.get(0);
    inputRowName=inMainConn.getName();
    boolean useDefault=ElementParameterParser.getValue(this,"String_Node_Str").equals("String_Node_Str");
    final String showInputRowName=inputRowName;
    if (useDefault) {
      IMetadataTable metadata=inMainConn.getMetadataTable();
      List<IMetadataColumn> listColumns=metadata.getListColumns();
      for (int i=0; i < listColumns.size(); i++) {
        INodeReturn flowToIterateReturn=new NodeReturn(){
          @Override public String getVarName(){
            String varName=super.getVarName();
switch (LanguageManager.getCurrentLanguage()) {
case PERL:
              varName=varName.replace(UNIQUE_NAME,showInputRowName + "String_Node_Str");
            break;
case JAVA:
          varName=varName.replace(UNIQUE_NAME + "String_Node_Str",showInputRowName + "String_Node_Str");
      }
      return varName;
    }
  }
;
  IMetadataColumn column=listColumns.get(i);
  String columnLabel=column.getLabel();
  String columnType=column.getTalendType();
  flowToIterateReturn.setName(columnLabel);
  flowToIterateReturn.setDisplayName(columnLabel);
  flowToIterateReturn.setType(columnType);
  flowToIterateReturn.setVarName(columnLabel);
  flowToIterateReturn.setAvailability("String_Node_Str");
  allReturns.add(flowToIterateReturn);
}
}
 else {
List<Map<String,String>> map=(List<Map<String,String>>)ElementParameterParser.getObjectValue(this,"String_Node_Str");
IMetadataTable metadata=inMainConn.getMetadataTable();
List<IMetadataColumn> listColumns=metadata.getListColumns();
for (int i=0; i < map.size(); i++) {
  Map<String,String> line=map.get(i);
  String keyName=TalendTextUtils.removeQuotes(line.get("String_Node_Str"));
  INodeReturn flowToIterateReturn=new NodeReturn(){
    @Override public String getVarName(){
      String varName=super.getVarName();
switch (LanguageManager.getCurrentLanguage()) {
case PERL:
        varName=varName.replace(UNIQUE_NAME,"String_Node_Str");
      break;
case JAVA:
    varName=varName.replace(UNIQUE_NAME + "String_Node_Str","String_Node_Str");
}
return varName;
}
}
;
String cueeName=line.get("String_Node_Str");
for (int j=0; j < listColumns.size(); j++) {
String columnName=listColumns.get(j).getLabel();
if (columnName.equals(cueeName)) {
String columnType=listColumns.get(j).getTalendType();
flowToIterateReturn.setType(columnType);
}
}
flowToIterateReturn.setName(keyName);
flowToIterateReturn.setDisplayName(keyName);
flowToIterateReturn.setVarName(keyName);
flowToIterateReturn.setAvailability("String_Node_Str");
allReturns.add(flowToIterateReturn);
}
}
}
}

Fixed version (ground truth):
private void getFlowToIterateReturns(List<INodeReturn> allReturns){
  List<? extends IConnection> inMainConns=this.getIncomingConnections();
  String inputRowName=null;
  IConnection inMainConn=null;
  if (inMainConns != null && !inMainConns.isEmpty()) {
    inMainConn=inMainConns.get(0);
    inputRowName=inMainConn.getName();
    boolean useDefault=ElementParameterParser.getValue(this,"String_Node_Str").equals("String_Node_Str");
    final String showInputRowName=inputRowName;
    if (useDefault) {
      IMetadataTable metadata=inMainConn.getMetadataTable();
      List<IMetadataColumn> listColumns=metadata.getListColumns();
      for (int i=0; i < listColumns.size(); i++) {
        INodeReturn flowToIterateReturn=new NodeReturn(){
          @Override public String getVarName(){
            String varName=super.getVarName();
switch (LanguageManager.getCurrentLanguage()) {
case PERL:
              varName=varName.replace(UNIQUE_NAME,showInputRowName + "String_Node_Str");
            break;
case JAVA:
          varName=varName.replace(UNIQUE_NAME + "String_Node_Str",showInputRowName + "String_Node_Str");
      }
      return varName;
    }
  }
;
  IMetadataColumn column=listColumns.get(i);
  String columnLabel=column.getLabel();
  String columnType=column.getTalendType();
  flowToIterateReturn.setName(columnLabel);
  flowToIterateReturn.setDisplayName(columnLabel);
  flowToIterateReturn.setType(columnType);
  flowToIterateReturn.setVarName(columnLabel);
  flowToIterateReturn.setAvailability("String_Node_Str");
  allReturns.add(flowToIterateReturn);
}
}
 else {
List<Map<String,String>> map=(List<Map<String,String>>)ElementParameterParser.getObjectValue(this,"String_Node_Str");
IMetadataTable metadata=inMainConn.getMetadataTable();
List<IMetadataColumn> listColumns=metadata.getListColumns();
for (int i=0; i < map.size(); i++) {
  Map<String,String> line=map.get(i);
  String keyName=TalendTextUtils.removeQuotes(line.get("String_Node_Str"));
  INodeReturn flowToIterateReturn=new NodeReturn(){
    @Override public String getVarName(){
      String varName=super.getVarName();
switch (LanguageManager.getCurrentLanguage()) {
case PERL:
        varName=varName.replace(UNIQUE_NAME,"String_Node_Str");
      break;
case JAVA:
    varName=varName.replace(UNIQUE_NAME + "String_Node_Str","String_Node_Str");
}
return varName;
}
}
;
String cueeName=line.get("String_Node_Str");
for (int j=0; j < listColumns.size(); j++) {
String columnName=listColumns.get(j).getLabel();
if (columnName.equals(cueeName)) {
String columnType=listColumns.get(j).getTalendType();
flowToIterateReturn.setType(columnType);
}
}
flowToIterateReturn.setName(keyName);
flowToIterateReturn.setDisplayName(cueeName);
flowToIterateReturn.setVarName(keyName);
flowToIterateReturn.setAvailability("String_Node_Str");
allReturns.add(flowToIterateReturn);
}
}
}
}