#fixed code
                                public void testReadLookahead1() throws Exception {
        ExtendedBufferedReader br = getBufferedReader("1\n2\r3\n");
        assertEquals('1', br.lookAhead());
        assertEquals(ExtendedBufferedReader.UNDEFINED, br.readAgain());
        assertEquals('1', br.read());
        assertEquals('1', br.readAgain());

        assertEquals(0, br.getLineNumber());
        assertEquals('\n', br.lookAhead());
        assertEquals(0, br.getLineNumber());
        assertEquals('1', br.readAgain());
        assertEquals('\n', br.read());
        assertEquals(1, br.getLineNumber());
        assertEquals('\n', br.readAgain());
        assertEquals(1, br.getLineNumber());

        assertEquals('2', br.lookAhead());
        assertEquals(1, br.getLineNumber());
        assertEquals('\n', br.readAgain());
        assertEquals(1, br.getLineNumber());
        assertEquals('2', br.read());
        assertEquals('2', br.readAgain());

        assertEquals('\r', br.lookAhead());
        assertEquals('2', br.readAgain());
        assertEquals('\r', br.read());
        assertEquals('\r', br.readAgain());

        assertEquals('3', br.lookAhead());
        assertEquals('\r', br.readAgain());
        assertEquals('3', br.read());
        assertEquals('3', br.readAgain());

        assertEquals('\n', br.lookAhead());
        assertEquals(1, br.getLineNumber());
        assertEquals('3', br.readAgain());
        assertEquals('\n', br.read());
        assertEquals(2, br.getLineNumber());
        assertEquals('\n', br.readAgain());
        assertEquals(2, br.getLineNumber());

        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.lookAhead());
        assertEquals('\n', br.readAgain());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.read());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.readAgain());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.read());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.lookAhead());

    }
#vulnerable code 
                                public void testReadLookahead1() throws Exception {

        assertEquals(ExtendedBufferedReader.END_OF_STREAM, getEBR("").read());
        ExtendedBufferedReader br = getEBR("1\n2\r3\n");
        assertEquals('1', br.lookAhead());
        assertEquals(ExtendedBufferedReader.UNDEFINED, br.readAgain());
        assertEquals('1', br.read());
        assertEquals('1', br.readAgain());

        assertEquals(0, br.getLineNumber());
        assertEquals('\n', br.lookAhead());
        assertEquals(0, br.getLineNumber());
        assertEquals('1', br.readAgain());
        assertEquals('\n', br.read());
        assertEquals(1, br.getLineNumber());
        assertEquals('\n', br.readAgain());
        assertEquals(1, br.getLineNumber());

        assertEquals('2', br.lookAhead());
        assertEquals(1, br.getLineNumber());
        assertEquals('\n', br.readAgain());
        assertEquals(1, br.getLineNumber());
        assertEquals('2', br.read());
        assertEquals('2', br.readAgain());

        assertEquals('\r', br.lookAhead());
        assertEquals('2', br.readAgain());
        assertEquals('\r', br.read());
        assertEquals('\r', br.readAgain());

        assertEquals('3', br.lookAhead());
        assertEquals('\r', br.readAgain());
        assertEquals('3', br.read());
        assertEquals('3', br.readAgain());

        assertEquals('\n', br.lookAhead());
        assertEquals(1, br.getLineNumber());
        assertEquals('3', br.readAgain());
        assertEquals('\n', br.read());
        assertEquals(2, br.getLineNumber());
        assertEquals('\n', br.readAgain());
        assertEquals(2, br.getLineNumber());

        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.lookAhead());
        assertEquals('\n', br.readAgain());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.read());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.readAgain());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.read());
        assertEquals(ExtendedBufferedReader.END_OF_STREAM, br.lookAhead());

    } 
                            #location 3 
                            #vulnerability type RESOURCE_LEAK