From e37b9acd2baa296d78cd0df02430c3a94723d26b Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Mon, 18 Nov 2024 19:37:01 +0100 Subject: [PATCH] cleanup --- src/main/java/org/htmlunit/javascript/host/Element.java | 8 ++------ src/main/java/org/htmlunit/javascript/host/Window.java | 5 ++--- src/test/java/org/htmlunit/ExternalTest.java | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/htmlunit/javascript/host/Element.java b/src/main/java/org/htmlunit/javascript/host/Element.java index e55b6f5210..73ee21d791 100644 --- a/src/main/java/org/htmlunit/javascript/host/Element.java +++ b/src/main/java/org/htmlunit/javascript/host/Element.java @@ -1080,12 +1080,8 @@ public void setId(final String newId) { @JsxFunction public void removeAttributeNode(final Attr attribute) { final String name = attribute.getName(); - final Object namespaceUri = attribute.getNamespaceURI(); - if (namespaceUri instanceof String) { - removeAttributeNS((String) namespaceUri, name); - return; - } - removeAttributeNS(null, name); + final String namespaceUri = attribute.getNamespaceURI(); + removeAttributeNS(namespaceUri, name); } /** diff --git a/src/main/java/org/htmlunit/javascript/host/Window.java b/src/main/java/org/htmlunit/javascript/host/Window.java index ff0beccd0b..bf0e9352a2 100644 --- a/src/main/java/org/htmlunit/javascript/host/Window.java +++ b/src/main/java/org/htmlunit/javascript/host/Window.java @@ -1395,9 +1395,8 @@ public void setOnmessage(final Object onmessage) { * @param e the error that needs to be reported */ public void triggerOnError(final ScriptException e) { - final Object o = getOnerror(); - if (o instanceof Function) { - final Function f = (Function) o; + final Function f = getOnerror(); + if (f != null) { String msg = e.getMessage(); final String url = e.getPage().getUrl().toExternalForm(); diff --git a/src/test/java/org/htmlunit/ExternalTest.java b/src/test/java/org/htmlunit/ExternalTest.java index c7ef61d926..fcc3af897a 100644 --- a/src/test/java/org/htmlunit/ExternalTest.java +++ b/src/test/java/org/htmlunit/ExternalTest.java @@ -55,7 +55,7 @@ public class ExternalTest { static String MAVEN_REPO_URL_ = "https://repo1.maven.org/maven2/"; /** Chrome driver. */ - static String CHROME_DRIVER_ = "130.0.6723"; + static String CHROME_DRIVER_ = "131.0.6778"; static String CHROME_DRIVER_URL_ = "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json";