Program: 118103
Project: 118103
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.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) {
          ConnectionUtils.closeConnection(connection);
        }
      }
 catch (      SQLException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void shutDownDb(DatabaseConnection databaseConnection){
  IMetadataConnection iMetadataConnection=null;
  if (selectedContext == null) {
    selectedContext=databaseConnection.getContextName();
  }
  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) {
          ConnectionUtils.closeConnection(connection);
        }
      }
 catch (      SQLException e) {
      }
    }
  }
}