#vulnerable code 
                                @Test
    public void testShutdown1() throws SQLException
    {
        Assert.assertSame("StubConnection count not as expected", 0, StubConnection.count.get());

        StubConnection.slowCreate = true;

        HikariConfig config = new HikariConfig();
        config.setMinimumIdle(0);
        config.setMaximumPoolSize(10);
        config.setInitializationFailFast(true);
        config.setConnectionTestQuery("VALUES 1");
        config.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

        final HikariDataSource ds = new HikariDataSource(config);
        HikariPool pool = TestElf.getPool(ds);

        Thread[] threads = new Thread[10];
        for (int i = 0; i < 10; i++)
        {
            threads[i] = new Thread() {
                public void run() {
                    try
                    {
                        if (ds.getConnection() != null)
                        {
                            PoolUtilities.quietlySleep(TimeUnit.SECONDS.toMillis(1));
                        }
                    }
                    catch (SQLException e)
                    {
                    }
                }
            };
            threads[i].setDaemon(true);
            threads[i].start();
        }

        PoolUtilities.quietlySleep(300);

        Assert.assertTrue("Totals connection count not as expected, ", pool.getTotalConnections() > 0);
        
        ds.shutdown();

        Assert.assertSame("Active connection count not as expected, ", 0, pool.getActiveConnections());
        Assert.assertSame("Idle connection count not as expected, ", 0, pool.getIdleConnections());
        Assert.assertSame("Total connection count not as expected", 0, pool.getTotalConnections());
    } 
                            #location 43 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testShutdown1() throws SQLException
    {
        Assert.assertSame("StubConnection count not as expected", 0, StubConnection.count.get());

        StubConnection.slowCreate = true;

        HikariConfig config = new HikariConfig();
        config.setMinimumIdle(0);
        config.setMaximumPoolSize(10);
        config.setInitializationFailFast(true);
        config.setConnectionTestQuery("VALUES 1");
        config.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

        final HikariDataSource ds = new HikariDataSource(config);
        HikariPool pool = TestElf.getPool(ds);

        Thread[] threads = new Thread[10];
        for (int i = 0; i < 10; i++)
        {
            threads[i] = new Thread() {
                public void run() {
                    try
                    {
                        if (ds.getConnection() != null)
                        {
                            PoolUtilities.quietlySleep(TimeUnit.SECONDS.toMillis(1));
                        }
                    }
                    catch (SQLException e)
                    {
                    }
                }
            };
            threads[i].setDaemon(true);
            threads[i].start();
        }

        PoolUtilities.quietlySleep(300);

        Assert.assertTrue("Totals connection count not as expected, ", pool.getTotalConnections() > 0);
        
        ds.close();

        Assert.assertSame("Active connection count not as expected, ", 0, pool.getActiveConnections());
        Assert.assertSame("Idle connection count not as expected, ", 0, pool.getIdleConnections());
        Assert.assertSame("Total connection count not as expected", 0, pool.getTotalConnections());
    }