#fixed code
                                @Test
    public void testBackfill() throws Exception
    {
        HikariConfig config = new HikariConfig();
        config.setMinimumIdle(1);
        config.setMaximumPoolSize(4);
        config.setConnectionTimeout(500);
        config.setInitializationFailFast(true);
        config.setConnectionTestQuery("VALUES 1");
        config.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

        HikariDataSource ds = new HikariDataSource(config);
        try
        {
            Assert.assertSame("Totals connections not as expected", 1, TestElf.getPool(ds).getTotalConnections());
            Assert.assertSame("Idle connections not as expected", 1, TestElf.getPool(ds).getIdleConnections());
    
            // This will take the pool down to zero
            Connection connection = ds.getConnection();
            Assert.assertNotNull(connection);
    
            Assert.assertSame("Totals connections not as expected", 1, TestElf.getPool(ds).getTotalConnections());
            Assert.assertSame("Idle connections not as expected", 0, TestElf.getPool(ds).getIdleConnections());
    
            PreparedStatement statement = connection.prepareStatement("SELECT some, thing FROM somewhere WHERE something=?");
            Assert.assertNotNull(statement);
    
            ResultSet resultSet = statement.executeQuery();
            Assert.assertNotNull(resultSet);
    
            try
            {
                statement.getMaxFieldSize();
                Assert.fail();
            }
            catch (Exception e)
            {
                Assert.assertSame(SQLException.class, e.getClass());
            }
    
            // The connection will be ejected from the pool here
            connection.close();
    
            Assert.assertSame("Totals connections not as expected", 0, TestElf.getPool(ds).getTotalConnections());
            Assert.assertSame("Idle connections not as expected", 0, TestElf.getPool(ds).getIdleConnections());

            // This will cause a backfill
            connection = ds.getConnection();
            connection.close();

            Assert.assertTrue("Totals connections not as expected", TestElf.getPool(ds).getTotalConnections() > 0);
            Assert.assertTrue("Idle connections not as expected", TestElf.getPool(ds).getIdleConnections() > 0);
        }
        finally
        {
            ds.close();
        }
    }
#vulnerable code 
                                @Test
    public void testBackfill() throws Exception
    {
        HikariConfig config = new HikariConfig();
        config.setMinimumIdle(1);
        config.setMaximumPoolSize(4);
        config.setConnectionTimeout(500);
        config.setInitializationFailFast(true);
        config.setConnectionTestQuery("VALUES 1");
        config.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

        HikariDataSource ds = new HikariDataSource(config);
        try
        {
            Assert.assertSame("Totals connections not as expected", 1, TestElf.getPool(ds).getTotalConnections());
            Assert.assertSame("Idle connections not as expected", 1, TestElf.getPool(ds).getIdleConnections());
    
            // This will take the pool down to zero
            Connection connection = ds.getConnection();
            Assert.assertNotNull(connection);
    
            Assert.assertSame("Totals connections not as expected", 1, TestElf.getPool(ds).getTotalConnections());
            Assert.assertSame("Idle connections not as expected", 0, TestElf.getPool(ds).getIdleConnections());
    
            PreparedStatement statement = connection.prepareStatement("SELECT some, thing FROM somewhere WHERE something=?");
            Assert.assertNotNull(statement);
    
            ResultSet resultSet = statement.executeQuery();
            Assert.assertNotNull(resultSet);
    
            try
            {
                statement.getMaxFieldSize();
                Assert.fail();
            }
            catch (Exception e)
            {
                Assert.assertSame(SQLException.class, e.getClass());
            }
    
            // The connection will be ejected from the pool here
            connection.close();
    
            Assert.assertSame("Totals connections not as expected", 0, TestElf.getPool(ds).getTotalConnections());
            Assert.assertSame("Idle connections not as expected", 0, TestElf.getPool(ds).getIdleConnections());

            // This will cause a backfill
            connection = ds.getConnection();
            connection.close();

            Assert.assertTrue("Totals connections not as expected", TestElf.getPool(ds).getTotalConnections() > 0);
            Assert.assertTrue("Idle connections not as expected", TestElf.getPool(ds).getIdleConnections() > 0);
        }
        finally
        {
            ds.shutdown();
        }
    } 
                            #location 56 
                            #vulnerability type RESOURCE_LEAK