Program: 74393
Project: 74393
Buggy source:
/** 
 * Get a connection to the database. If one is already open, then simply return that one. Otherwise, use the parameter values and prompt for a password to open a new connection.
 * @return A connection to the database, or null if none issuccessfully created.
 */
public Connection getConnection() throws IllegalActionException {
  if (_connection != null) {
    return _connection;
  }
  Effigy effigy=Configuration.findEffigy(toplevel());
  JFrame frame=null;
  if (effigy != null) {
    Tableau tableau=effigy.showTableaux();
    if (tableau != null) {
      frame=tableau.getFrame();
    }
  }
  Query query=new Query();
  query.setTextWidth(60);
  query.addLine("String_Node_Str","String_Node_Str",database.getExpression());
  query.addLine("String_Node_Str","String_Node_Str",userName.getExpression());
  query.addPassword("String_Node_Str","String_Node_Str","String_Node_Str");
  ComponentDialog dialog=new ComponentDialog(frame,"String_Node_Str",query);
  if (dialog.buttonPressed().equals("String_Node_Str")) {
    database.setExpression(query.getStringValue("String_Node_Str"));
    userName.setExpression(query.getStringValue("String_Node_Str"));
    char[] passwordValue=query.getCharArrayValue("String_Node_Str");
    try {
      DriverManager.registerDriver(new OracleDriver());
      _connection=DriverManager.getConnection(database.getExpression(),userName.getExpression(),new String(passwordValue));
      _connection.setAutoCommit(false);
    }
 catch (    SQLException e) {
      throw new IllegalActionException(this,e,"String_Node_Str");
    }
  }
  return _connection;
}

Fixed version (ground truth):
/** 
 * Get a connection to the database. If one is already open, then simply return that one. Otherwise, use the parameter values and prompt for a password to open a new connection.
 * @return A connection to the database, or null if none issuccessfully created.
 */
public Connection getConnection() throws IllegalActionException {
  if (_connection != null) {
    return _connection;
  }
  Effigy effigy=Configuration.findEffigy(toplevel());
  JFrame frame=null;
  if (effigy != null) {
    Tableau tableau=effigy.showTableaux();
    if (tableau != null) {
      frame=tableau.getFrame();
    }
  }
  Query query=new Query();
  query.setTextWidth(60);
  query.addLine("String_Node_Str","String_Node_Str",database.stringValue());
  query.addLine("String_Node_Str","String_Node_Str",userName.stringValue());
  query.addPassword("String_Node_Str","String_Node_Str","String_Node_Str");
  ComponentDialog dialog=new ComponentDialog(frame,"String_Node_Str",query);
  if (dialog.buttonPressed().equals("String_Node_Str")) {
    database.setExpression(query.getStringValue("String_Node_Str"));
    userName.setExpression(query.getStringValue("String_Node_Str"));
    char[] passwordValue=query.getCharArrayValue("String_Node_Str");
    try {
      DriverManager.registerDriver(new OracleDriver());
      _connection=DriverManager.getConnection(database.getExpression(),userName.getExpression(),new String(passwordValue));
      _connection.setAutoCommit(false);
    }
 catch (    SQLException e) {
      throw new IllegalActionException(this,e,"String_Node_Str");
    }
  }
  return _connection;
}