Program: 123292
Project: 123292
Buggy source:
/** 
 * Constructs a new FileInputNode.
 */
public FileInputDelimitedNode(String filename,String rowSep,String fieldSep,int limitRows,int headerRows,int footerRows,String escapeChar,String textEnclosure,boolean removeEmptyRow,boolean spitRecord,String encoding,EShadowProcessType fileType){
  super("String_Node_Str");
  boolean csvoption=false;
  String languageName=LanguageManager.getCurrentLanguage().getName();
switch (fileType) {
case FILE_DELIMITED:
    csvoption=false;
  if (languageName.equals("String_Node_Str")) {
    int max=getColumnCount(filename,rowSep,fieldSep,limitRows,headerRows,escapeChar,textEnclosure,EShadowProcessType.FILE_DELIMITED);
    this.setColumnNumber(max);
  }
 else {
    int max=0;
    try {
      max=FileInputDelimited.getMaxColumnCount(trimParameter(filename),trimParameter(encoding),trimParameter(StringUtils.loadConvert(fieldSep,languageName)),trimParameter(StringUtils.loadConvert(rowSep,languageName)),true,spitRecord,headerRows,limitRows);
    }
 catch (    IOException e) {
      ExceptionHandler.process(e);
    }
    if (max > 0) {
      this.setColumnNumber(max);
    }
  }
break;
case FILE_CSV:
csvoption=true;
if (languageName.equals("String_Node_Str")) {
int max=getColumnCount(filename,rowSep,fieldSep,limitRows,headerRows,escapeChar,textEnclosure,EShadowProcessType.FILE_CSV);
this.setColumnNumber(max);
}
 else {
CSVReader cr=null;
try {
cr=new SimpleReader();
cr.setSeperator(trimParameter(StringUtils.loadConvert(fieldSep,languageName)).charAt(0));
List items=cr.parse(new File(filename));
for (int i=0; i < headerRows && items.size() > 0; i++) {
}
int columnCount=0;
for (int i=0; i < limitRows && items.size() > 0; i++) {
  String[] item=(String[])items.get(i);
  int temp=item.length;
  if (temp > columnCount) {
    columnCount=temp;
  }
}
if (columnCount > 0) {
  this.setColumnNumber(columnCount);
}
}
 catch (UnsupportedEncodingException e) {
ExceptionHandler.process(e);
}
catch (FileNotFoundException e) {
ExceptionHandler.process(e);
}
catch (IOException e) {
ExceptionHandler.process(e);
}
 finally {
if (cr != null) {
}
}
}
break;
default :
break;
}
String[] paramNames=null;
if (!csvoption) {
paramNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
}
 else {
paramNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
}
String[] paramValues=new String[]{filename,rowSep,fieldSep,Integer.toString(limitRows),Integer.toString(headerRows),Integer.toString(footerRows),escapeChar,textEnclosure,Boolean.toString(removeEmptyRow),encoding,Boolean.toString(csvoption),Boolean.toString(spitRecord)};
for (int i=0; i < paramNames.length; i++) {
if (paramValues[i] != null) {
TextElementParameter param=new TextElementParameter(paramNames[i],paramValues[i]);
addParameter(param);
}
}
}

Fixed version (ground truth):
/** 
 * Constructs a new FileInputNode.
 */
public FileInputDelimitedNode(String filename,String rowSep,String fieldSep,int limitRows,int headerRows,int footerRows,String escapeChar,String textEnclosure,boolean removeEmptyRow,boolean spitRecord,String encoding,EShadowProcessType fileType){
  super("String_Node_Str");
  boolean csvoption=false;
  String languageName=LanguageManager.getCurrentLanguage().getName();
switch (fileType) {
case FILE_DELIMITED:
    csvoption=false;
  if (languageName.equals("String_Node_Str")) {
    int max=getColumnCount(filename,rowSep,fieldSep,limitRows,headerRows,escapeChar,textEnclosure,EShadowProcessType.FILE_DELIMITED);
    this.setColumnNumber(max);
  }
 else {
    int max=0;
    try {
      max=FileInputDelimited.getMaxColumnCount(trimParameter(filename),trimParameter(encoding),trimParameter(StringUtils.loadConvert(fieldSep,languageName)),trimParameter(StringUtils.loadConvert(rowSep,languageName)),true,spitRecord,headerRows,limitRows);
    }
 catch (    IOException e) {
      ExceptionHandler.process(e);
    }
    if (max > 0) {
      this.setColumnNumber(max);
    }
  }
break;
case FILE_CSV:
csvoption=true;
if (languageName.equals("String_Node_Str")) {
int max=getColumnCount(filename,rowSep,fieldSep,limitRows,headerRows,escapeChar,textEnclosure,EShadowProcessType.FILE_CSV);
this.setColumnNumber(max);
}
 else {
CSVReader cr=null;
try {
cr=new SimpleReader();
cr.setSeperator(trimParameter(StringUtils.loadConvert(fieldSep,languageName)).charAt(0));
List items=cr.parse(new File(TalendTextUtils.removeQuotes(filename)));
for (int i=0; i < headerRows && items.size() > 0; i++) {
}
int columnCount=0;
for (int i=0; i < limitRows && items.size() > 0; i++) {
  String[] item=(String[])items.get(i);
  int temp=item.length;
  if (temp > columnCount) {
    columnCount=temp;
  }
}
if (columnCount > 0) {
  this.setColumnNumber(columnCount);
}
}
 catch (UnsupportedEncodingException e) {
ExceptionHandler.process(e);
}
catch (FileNotFoundException e) {
ExceptionHandler.process(e);
}
catch (IOException e) {
ExceptionHandler.process(e);
}
 finally {
if (cr != null) {
}
}
}
break;
default :
break;
}
String[] paramNames=null;
if (!csvoption) {
paramNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
}
 else {
paramNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
}
String[] paramValues=new String[]{filename,rowSep,fieldSep,Integer.toString(limitRows),Integer.toString(headerRows),Integer.toString(footerRows),escapeChar,textEnclosure,Boolean.toString(removeEmptyRow),encoding,Boolean.toString(csvoption),Boolean.toString(spitRecord)};
for (int i=0; i < paramNames.length; i++) {
if (paramValues[i] != null) {
TextElementParameter param=new TextElementParameter(paramNames[i],paramValues[i]);
addParameter(param);
}
}
}