Program: 3545
Project: 3545
Buggy source:
/** 
 * Constructor.
 * @param table The table for which to get find a primary key.
 * @throws SQLException
 */
public PrimaryKeyFinder(String table) throws SQLException {
  this.table=table;
  if (table == null || table.trim().length() == 0) {
    throw new SQLException("String_Node_Str" + this.table + "String_Node_Str");
  }
  Statement stat=null;
  ResultSet rs=null;
  try {
    stat=conn.createStatement();
    rs=stat.executeQuery("String_Node_Str" + "String_Node_Str" + escape(table) + "String_Node_Str");
    if (!rs.next())     throw new SQLException("String_Node_Str" + table + "String_Node_Str");
    Matcher matcher=PK_NAMED_PATTERN.matcher(rs.getString(1));
    if (matcher.find()) {
      pkName='\'' + escape(matcher.group(1).toLowerCase()) + '\'';
      pkColumns=matcher.group(2).split("String_Node_Str");
    }
 else {
      matcher=PK_UNNAMED_PATTERN.matcher(rs.getString(1));
      if (matcher.find()) {
        pkColumns=matcher.group(1).split("String_Node_Str");
      }
    }
    if (pkColumns == null) {
      rs=stat.executeQuery("String_Node_Str" + escape(table) + "String_Node_Str");
      while (rs.next()) {
        if (rs.getBoolean(6))         pkColumns=new String[]{rs.getString(2)};
      }
    }
    if (pkColumns != null)     for (int i=0; i < pkColumns.length; i++) {
      pkColumns[i]=pkColumns[i].toLowerCase().trim();
    }
  }
  finally {
    try {
      if (rs != null)       rs.close();
    }
 catch (    Exception e1) {
    }
    try {
      if (stat != null)       stat.close();
    }
 catch (    Exception e1) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param table The table for which to get find a primary key.
 * @throws SQLException
 */
public PrimaryKeyFinder(String table) throws SQLException {
  this.table=table;
  if (table == null || table.trim().length() == 0) {
    throw new SQLException("String_Node_Str" + this.table + "String_Node_Str");
  }
  Statement stat=null;
  ResultSet rs=null;
  try {
    stat=conn.createStatement();
    rs=stat.executeQuery("String_Node_Str" + "String_Node_Str" + escape(table) + "String_Node_Str");
    if (!rs.next())     throw new SQLException("String_Node_Str" + table + "String_Node_Str");
    Matcher matcher=PK_NAMED_PATTERN.matcher(rs.getString(1));
    if (matcher.find()) {
      pkName='\'' + escape(matcher.group(1).toLowerCase()) + '\'';
      pkColumns=matcher.group(2).split("String_Node_Str");
    }
 else {
      matcher=PK_UNNAMED_PATTERN.matcher(rs.getString(1));
      if (matcher.find()) {
        pkColumns=matcher.group(1).split("String_Node_Str");
      }
    }
    if (pkColumns == null) {
      rs=stat.executeQuery("String_Node_Str" + escape(table) + "String_Node_Str");
      while (rs.next()) {
        if (rs.getBoolean(6))         pkColumns=new String[]{rs.getString(2)};
      }
    }
    if (pkColumns != null)     for (int i=0; i < pkColumns.length; i++) {
      pkColumns[i]=pkColumns[i].toLowerCase().trim();
    }
  }
  finally {
    try {
      if (rs != null)       rs.close();
    }
 catch (    Exception e) {
    }
    try {
      if (stat != null)       stat.close();
    }
 catch (    Exception e) {
    }
  }
}