#fixed code
                              @Override
  public void onPageLoad() {
    System.err.println("new page loaded");
    pageLoaded = true;
    reset();
    try {
      Thread.sleep(5000);
      System.out.println(
          "on page load:" + session.getWebInspector().getProtocol().sendCommand(DOM.getDocument())
              .optJSONObject("root").optString("documentURL"));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
#vulnerable code 
                              @Override
  public void onPageLoad() {
    System.err.println("new page loaded");
    pageLoaded = true;
    reset();
  } 
                            #location 5 
                            #vulnerability type THREAD_SAFETY_VIOLATION