(final URL url, final Page page)
| 100 | } |
| 101 | |
| 102 | void setUrl(final URL url, final Page page) { |
| 103 | if (url != null) { |
| 104 | WebWindow webWindow = null; |
| 105 | if (page != null) { |
| 106 | webWindow = page.getEnclosingWindow(); |
| 107 | } |
| 108 | |
| 109 | final URL encoded = UrlUtils.encodeUrl(url, webRequest_.getCharset()); |
| 110 | webRequest_.setUrl(encoded); |
| 111 | if (page != null) { |
| 112 | page.getWebResponse().getWebRequest().setUrl(encoded); |
| 113 | if (webWindow != null) { |
| 114 | final Window win = webWindow.getScriptableObject(); |
| 115 | if (win != null) { |
| 116 | win.getLocation().setHash(null, encoded.getRef(), false); |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * @return the state object |
no test coverage detected