#vulnerable code 
                                @Test
    public void testReadLine() throws Exception {
        ExtendedBufferedReader br = getBufferedReader("");
        assertNull(br.readLine());

        br = getBufferedReader("\n");
        assertEquals("",br.readLine());
        assertNull(br.readLine());

        br = getBufferedReader("foo\n\nhello");
        assertEquals(0, br.getCurrentLineNumber());
        assertEquals("foo",br.readLine());
        assertEquals(1, br.getCurrentLineNumber());
        assertEquals("",br.readLine());
        assertEquals(2, br.getCurrentLineNumber());
        assertEquals("hello",br.readLine());
        assertEquals(3, br.getCurrentLineNumber());
        assertNull(br.readLine());
        assertEquals(3, br.getCurrentLineNumber());

        br = getBufferedReader("foo\n\nhello");
        assertEquals('f', br.read());
        assertEquals('o', br.lookAhead());
        assertEquals("oo",br.readLine());
        assertEquals(1, br.getCurrentLineNumber());
        assertEquals('\n', br.lookAhead());
        assertEquals("",br.readLine());
        assertEquals(2, br.getCurrentLineNumber());
        assertEquals('h', br.lookAhead());
        assertEquals("hello",br.readLine());
        assertNull(br.readLine());
        assertEquals(3, br.getCurrentLineNumber());


        br = getBufferedReader("foo\rbaar\r\nfoo");
        assertEquals("foo",br.readLine());
        assertEquals('b', br.lookAhead());
        assertEquals("baar",br.readLine());
        assertEquals('f', br.lookAhead());
        assertEquals("foo",br.readLine());
        assertNull(br.readLine());
    } 
                            #location 4 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testReadLine() throws Exception {
        ExtendedBufferedReader br = getBufferedReader("");
        assertNull(br.readLine());

        br.close();
        br = getBufferedReader("\n");
        assertEquals("",br.readLine());
        assertNull(br.readLine());

        br.close();
        br = getBufferedReader("foo\n\nhello");
        assertEquals(0, br.getCurrentLineNumber());
        assertEquals("foo",br.readLine());
        assertEquals(1, br.getCurrentLineNumber());
        assertEquals("",br.readLine());
        assertEquals(2, br.getCurrentLineNumber());
        assertEquals("hello",br.readLine());
        assertEquals(3, br.getCurrentLineNumber());
        assertNull(br.readLine());
        assertEquals(3, br.getCurrentLineNumber());

        br.close();
        br = getBufferedReader("foo\n\nhello");
        assertEquals('f', br.read());
        assertEquals('o', br.lookAhead());
        assertEquals("oo",br.readLine());
        assertEquals(1, br.getCurrentLineNumber());
        assertEquals('\n', br.lookAhead());
        assertEquals("",br.readLine());
        assertEquals(2, br.getCurrentLineNumber());
        assertEquals('h', br.lookAhead());
        assertEquals("hello",br.readLine());
        assertNull(br.readLine());
        assertEquals(3, br.getCurrentLineNumber());


        br.close();
        br = getBufferedReader("foo\rbaar\r\nfoo");
        assertEquals("foo",br.readLine());
        assertEquals('b', br.lookAhead());
        assertEquals("baar",br.readLine());
        assertEquals('f', br.lookAhead());
        assertEquals("foo",br.readLine());
        assertNull(br.readLine());
        br.close();
    }