#vulnerable code 
                                public void testReadLine() throws Exception {
        ExtendedBufferedReader br = getEBR("");
        assertTrue(br.readLine() == null);

        br = getEBR("\n");
        assertTrue(br.readLine().equals(""));
        assertTrue(br.readLine() == null);

        br = getEBR("foo\n\nhello");
        assertEquals(0, br.getLineNumber());
        assertTrue(br.readLine().equals("foo"));
        assertEquals(1, br.getLineNumber());
        assertTrue(br.readLine().equals(""));
        assertEquals(2, br.getLineNumber());
        assertTrue(br.readLine().equals("hello"));
        assertEquals(3, br.getLineNumber());
        assertTrue(br.readLine() == null);
        assertEquals(3, br.getLineNumber());

        br = getEBR("foo\n\nhello");
        assertEquals('f', br.read());
        assertEquals('o', br.lookAhead());
        assertTrue(br.readLine().equals("oo"));
        assertEquals(1, br.getLineNumber());
        assertEquals('\n', br.lookAhead());
        assertTrue(br.readLine().equals(""));
        assertEquals(2, br.getLineNumber());
        assertEquals('h', br.lookAhead());
        assertTrue(br.readLine().equals("hello"));
        assertTrue(br.readLine() == null);
        assertEquals(3, br.getLineNumber());


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

        br = getBufferedReader("\n");
        assertTrue(br.readLine().equals(""));
        assertTrue(br.readLine() == null);

        br = getBufferedReader("foo\n\nhello");
        assertEquals(0, br.getLineNumber());
        assertTrue(br.readLine().equals("foo"));
        assertEquals(1, br.getLineNumber());
        assertTrue(br.readLine().equals(""));
        assertEquals(2, br.getLineNumber());
        assertTrue(br.readLine().equals("hello"));
        assertEquals(3, br.getLineNumber());
        assertTrue(br.readLine() == null);
        assertEquals(3, br.getLineNumber());

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


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