#fixed 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);
  }
#vulnerable code 
                              public void testReadLine() throws Exception {
    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 5 
                            #vulnerability type RESOURCE_LEAK