From: <asa...@us...> - 2013-09-12 11:39:32
|
Revision: 8473 http://sourceforge.net/p/htmlunit/code/8473 Author: asashour Date: 2013-09-12 11:39:28 +0000 (Thu, 12 Sep 2013) Log Message: ----------- - Fix 'unused' and some deprecation warnings Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java 2013-09-12 11:07:13 UTC (rev 8472) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java 2013-09-12 11:39:28 UTC (rev 8473) @@ -538,11 +538,15 @@ } final Event keyDown = new KeyboardEvent(this, Event.TYPE_KEY_DOWN, keyCode, shiftKey, ctrlKey, altKey); - final ScriptResult keyDownResult = fireEvent(keyDown); + @SuppressWarnings("unused") + final ScriptResult keyDownResult = fireEvent(keyDown); + final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(KEYBOARD_EVENT_SPECIAL_KEYPRESS)) { final Event keyPress = new KeyboardEvent(this, Event.TYPE_KEY_PRESS, keyCode, shiftKey, ctrlKey, altKey); + + @SuppressWarnings("unused") final ScriptResult keyPressResult = fireEvent(keyPress); } Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java 2013-09-12 11:07:13 UTC (rev 8472) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java 2013-09-12 11:39:28 UTC (rev 8473) @@ -55,8 +55,10 @@ /* Do not use this URL without Google permission! */ private static String PROVIDER_URL_ = "https://maps.googleapis.com/maps/api/browserlocation/json"; private Function successHandler_; - private Function errorHandler_; + @SuppressWarnings("unused") + private Function errorHandler_; + /** * Creates an instance. JavaScript objects must have a default constructor. */ Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java 2013-09-12 11:07:13 UTC (rev 8472) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java 2013-09-12 11:39:28 UTC (rev 8473) @@ -451,7 +451,7 @@ final HtmlPage page = loadPage(htmlContent); final HtmlForm form = page.getHtmlElementById("form1"); - final HtmlInput input = form.getElementById("foo"); + final HtmlInput input = page.getHtmlElementById("foo"); assertSame(form, input.getEnclosingForm()); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java 2013-09-12 11:07:13 UTC (rev 8472) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java 2013-09-12 11:39:28 UTC (rev 8473) @@ -182,6 +182,7 @@ list.add(entryName.replace('/', '.').replace('\\', '.').replace(".class", "")); } } + jarFile.close(); } catch (final IOException e) { throw new RuntimeException(packageName + " does not appear to be a valid package", e); |