#fixed code
                                @Test
    public void testAutoCommit() throws SQLException
    {
        HikariDataSource ds = new HikariDataSource();
        ds.setAutoCommit(true);
        ds.setMinimumIdle(1);
        ds.setMaximumPoolSize(1);
        ds.setConnectionTestQuery("VALUES 1");
        ds.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

        try
        {
            Connection connection = ds.getConnection();
            connection.setAutoCommit(false);
            connection.close();

            Connection connection2 = ds.getConnection();
            Assert.assertSame(connection, connection2);
            Assert.assertTrue(connection2.getAutoCommit());
            connection2.close();
        }
        finally
        {
            ds.close();
        }
    }
#vulnerable code 
                                @Test
    public void testAutoCommit() throws SQLException
    {
        HikariDataSource ds = new HikariDataSource();
        ds.setAutoCommit(true);
        ds.setMinimumIdle(1);
        ds.setMaximumPoolSize(1);
        ds.setConnectionTestQuery("VALUES 1");
        ds.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

        try
        {
            Connection connection = ds.getConnection();
            connection.setAutoCommit(false);
            connection.close();

            Connection connection2 = ds.getConnection();
            Assert.assertSame(connection, connection2);
            Assert.assertTrue(connection2.getAutoCommit());
            connection2.close();
        }
        finally
        {
            ds.shutdown();
        }
    } 
                            #location 24 
                            #vulnerability type RESOURCE_LEAK