[jdk11u-dev] RFR: 8290813 jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java fails: assertEquals is ambiguous

Attila Szegedi attila at openjdk.org
Thu Jul 21 14:56:05 UTC 2022


On Thu, 21 Jul 2022 14:17:32 GMT, George Adams <duke at openjdk.org> wrote:

> Required as part of the jtreg 6 update - Tested locally and passes on my machine

Changes requested by attila (Reviewer).

test/nashorn/src/jdk/nashorn/api/scripting/test/ScriptObjectMirrorTest.java line 285:

> 283:         ScriptObjectMirror obj = (ScriptObjectMirror)e.eval(
> 284:             "({ valueOf: function() { return 42 } })");
> 285:         assertEquals(new Double(42.0), obj.to(Double.class));

Suggestion:

        assertEquals(Double.valueOf(42.0), obj.to(Double.class));

`Double` constructor is deprecated since Java 9.

-------------

PR: https://git.openjdk.org/jdk11u-dev/pull/1255


More information about the jdk-updates-dev mailing list