Program: 120570
Project: 120570
Buggy source:
private void shutDownDb(DatabaseConnection databaseConnection){
  IMetadataConnection iMetadataConnection=null;
  iMetadataConnection=ConvertionHelper.convert(databaseConnection,false,selectedContext);
  String dbType=iMetadataConnection.getDbType();
  String driverClassName=iMetadataConnection.getDriverClass();
  if (driverClassName.equals(EDatabase4DriverClassName.JAVADB_EMBEDED.getDriverClass()) || dbType.equals(EDatabaseTypeName.JAVADB_EMBEDED.getDisplayName()) || dbType.equals(EDatabaseTypeName.JAVADB_DERBYCLIENT.getDisplayName())|| dbType.equals(EDatabaseTypeName.JAVADB_JCCJDBC.getDisplayName())|| dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName())) {
    String username=iMetadataConnection.getUsername();
    String pwd=iMetadataConnection.getPassword();
    String dbVersion=iMetadataConnection.getDbVersionString();
    String url=iMetadataConnection.getUrl();
    Connection connection=null;
    DriverShim wapperDriver=null;
    try {
      List list=ExtractMetaDataUtils.connect(dbType,url,username,pwd,driverClassName,iMetadataConnection.getDriverJarPath(),dbVersion,iMetadataConnection.getAdditionalParams());
      if (list != null && list.size() > 0) {
        for (int i=0; i < list.size(); i++) {
          if (list.get(i) instanceof Connection) {
            connection=(Connection)list.get(i);
          }
          if (list.get(i) instanceof DriverShim) {
            wapperDriver=(DriverShim)list.get(i);
          }
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
 finally {
      try {
        if (wapperDriver != null) {
          wapperDriver.connect("String_Node_Str",null);
        }
        if (connection != null) {
          final Statement createStatement=connection.createStatement();
          createStatement.execute("String_Node_Str");
          createStatement.close();
          connection.close();
        }
      }
 catch (      SQLException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void shutDownDb(DatabaseConnection databaseConnection){
  IMetadataConnection iMetadataConnection=null;
  iMetadataConnection=ConvertionHelper.convert(databaseConnection,false,selectedContext);
  String dbType=iMetadataConnection.getDbType();
  String driverClassName=iMetadataConnection.getDriverClass();
  if (driverClassName.equals(EDatabase4DriverClassName.JAVADB_EMBEDED.getDriverClass()) || dbType.equals(EDatabaseTypeName.JAVADB_EMBEDED.getDisplayName()) || dbType.equals(EDatabaseTypeName.JAVADB_DERBYCLIENT.getDisplayName())|| dbType.equals(EDatabaseTypeName.JAVADB_JCCJDBC.getDisplayName())|| dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName())) {
    String username=iMetadataConnection.getUsername();
    String pwd=iMetadataConnection.getPassword();
    String dbVersion=iMetadataConnection.getDbVersionString();
    String url=iMetadataConnection.getUrl();
    Connection connection=null;
    DriverShim wapperDriver=null;
    try {
      List list=ExtractMetaDataUtils.getInstance().connect(dbType,url,username,pwd,driverClassName,iMetadataConnection.getDriverJarPath(),dbVersion,iMetadataConnection.getAdditionalParams());
      if (list != null && list.size() > 0) {
        for (int i=0; i < list.size(); i++) {
          if (list.get(i) instanceof Connection) {
            connection=(Connection)list.get(i);
          }
          if (list.get(i) instanceof DriverShim) {
            wapperDriver=(DriverShim)list.get(i);
          }
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
 finally {
      try {
        if (wapperDriver != null) {
          wapperDriver.connect("String_Node_Str",null);
        }
        if (connection != null) {
          final Statement createStatement=connection.createStatement();
          createStatement.execute("String_Node_Str");
          createStatement.close();
          connection.close();
        }
      }
 catch (      SQLException e) {
      }
    }
  }
}