Program: 80037
Project: 80037
Buggy source:
/** 
 * All columns in the Db2jLogReader VTI have a of String type.
 * @see java.sql.ResultSet#getString
 * @exception SQLException If database-access error occurs.
 */
public String getString(int columnNumber) throws SQLException {
switch (columnNumber) {
case 1:
    return line.substring(0,gmtIndex);
case 2:
  return line.substring(threadIndex + 1,line.indexOf(END_THREAD_STRING));
case 3:
return line.substring(xidIndex + 2,line.indexOf(END_XID_STRING,xidIndex));
case 4:
return line.substring(lccidIndex + 2,line.indexOf(END_XID_STRING,lccidIndex));
case 5:
return line.substring(databaseIndex + BEGIN_DATABASE_STRING.length(),line.indexOf(END_DATABASE_STRING,databaseIndex));
case 6:
return line.substring(drdaidIndex + BEGIN_DRDAID_STRING.length(),line.indexOf(END_DRDAID_STRING,drdaidIndex));
case 7:
StringBuffer output=new StringBuffer(64);
if (line.indexOf(BEGIN_EXECUTING_STRING) == -1) {
output.append(line.substring(line.indexOf(END_DRDAID_STRING,drdaidIndex) + 3));
}
 else {
int endIndex=line.indexOf(END_EXECUTING_STRING,drdaidIndex);
if (endIndex == -1) {
output.append(line.substring(line.indexOf(END_DRDAID_STRING,drdaidIndex) + 3));
}
 else {
output.append(line.substring(line.indexOf(END_XID_STRING,drdaidIndex) + 3,endIndex));
}
while (endIndex == -1) {
try {
line=bufferedReader.readLine();
}
 catch (java.io.IOException ioe) {
throw new SQLException("String_Node_Str" + ioe);
}
endIndex=line.indexOf(END_EXECUTING_STRING);
if (endIndex == -1) {
output.append(line);
}
 else {
output.append(line.substring(0,endIndex));
}
}
}
return StringUtil.truncate(output.toString(),Limits.DB2_VARCHAR_MAXWIDTH);
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
/** 
 * All columns in the Db2jLogReader VTI have a of String type.
 * @see java.sql.ResultSet#getString
 * @exception SQLException If database-access error occurs.
 */
public String getString(int columnNumber) throws SQLException {
switch (columnNumber) {
case 1:
    return line.substring(0,endTimestampIndex);
case 2:
  return line.substring(threadIndex + 1,line.indexOf(END_THREAD_STRING));
case 3:
return line.substring(xidIndex + 2,line.indexOf(END_XID_STRING,xidIndex));
case 4:
return line.substring(lccidIndex + 2,line.indexOf(END_XID_STRING,lccidIndex));
case 5:
return line.substring(databaseIndex + BEGIN_DATABASE_STRING.length(),line.indexOf(END_DATABASE_STRING,databaseIndex));
case 6:
return line.substring(drdaidIndex + BEGIN_DRDAID_STRING.length(),line.indexOf(END_DRDAID_STRING,drdaidIndex));
case 7:
StringBuffer output=new StringBuffer(64);
if (line.indexOf(BEGIN_EXECUTING_STRING) == -1) {
output.append(line.substring(line.indexOf(END_DRDAID_STRING,drdaidIndex) + 3));
}
 else {
int endIndex=line.indexOf(END_EXECUTING_STRING,drdaidIndex);
if (endIndex == -1) {
output.append(line.substring(line.indexOf(END_DRDAID_STRING,drdaidIndex) + 3));
}
 else {
output.append(line.substring(line.indexOf(END_XID_STRING,drdaidIndex) + 3,endIndex));
}
while (endIndex == -1) {
try {
line=bufferedReader.readLine();
}
 catch (java.io.IOException ioe) {
throw new SQLException("String_Node_Str" + ioe);
}
endIndex=line.indexOf(END_EXECUTING_STRING);
if (endIndex == -1) {
output.append(line);
}
 else {
output.append(line.substring(0,endIndex));
}
}
}
return StringUtil.truncate(output.toString(),Limits.DB2_VARCHAR_MAXWIDTH);
default :
return "String_Node_Str";
}
}