Search code examples
java-8nashorn

Coercion of Enums in Nashorn works differently than in Rhino


It seems that Java enums are no longer coerced into their string value:

java.math.RoundingMode.UP == "UP"

evaluates to true in Java 7 but to false in Java 8 when executed in the JavaScript engine.

Does anybody know if this is actually a bug or just something in the specification?

Thanks!


Solution

  • This is a bug: https://bugs.openjdk.java.net/browse/JDK-8072426 .....................................................................