Problem with HashMap

No on two counts.

1. That part of that post is talking about ECMAScript 5.1, not ECMAScript 2021

In 2026, Java 11 will reach end of life. Nashorn JavaScript (ECMAScript 5.1) is embedded in Java so in 2026 or when openHAB moves to any version of Java after Java 11, Nashorn will no longer come with Java by default.

At the time of writing that post I made the admittedly wrong assumption (I knew it was wrong when I made it) that openHAB would stay on Java 11 until it reached end of life. But that is neither reasonable nor practical so 2026 would be the latest but the actual would likely be much sooner.

ECMAScript 2021 is completely separate from Nashorn. ECMAScript 2021 provides a modern version of JavaScript, and as long as Java supports GraalVM (the mechanism used to bring in support for ECMAScript 2021) it’ll be supportable in openHAB. To get ECMAScript 2021, install the JS Scripting add-on.

2. Nashorn is now supported as a separate plugin

At the time of writing that post, JavaScript Scripting (Nashorn) [3.3.0.0;4.0.0.0) didn’t exist so the assumption was that when Nashorn is gone from the JDK, it’ll be gone for good.

However, with Nashorn on the marketplace continued support for it is available beyond when OH moves beyond Java 11 (Java 17 is the current targeted minimum for the future).