-
Bug
-
Resolution: Fixed
-
P4
-
8
-
None
-
javafx.version=8.0.0, java.runtime.name=Java(TM) SE Runtime Environment, java.vm.version=25.0-b70, user.country.format=CH, java.vm.vendor=Oracle Corporation, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, file.encoding.pkg=sun.io, user.country=US, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=unknown, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.vendor=Oracle Corporation, os.name=Mac OS X, sun.jnu.encoding=UTF-8, java.specification.name=Java Platform API Specification, java.class.version=52.0, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, os.version=10.9.2, java.specification.version=1.8
javafx.version=8.0.0, java.runtime.name=Java(TM) SE Runtime Environment, java.vm.version=25.0-b70, user.country.format=CH, java.vm.vendor=Oracle Corporation, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, file.encoding.pkg=sun.io, user.country=US, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=unknown, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.vendor=Oracle Corporation, os.name=Mac OS X, sun.jnu.encoding=UTF-8, java.specification.name=Java Platform API Specification, java.class.version=52.0, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, os.version=10.9.2, java.specification.version=1.8
${7.0 * 0.4 - 2 * 3.5} should evaluate to -4.2 with following tokens (inside method parse after tokenize)
7.0, 0.4, 2, 3.5, *, *, -
but is
7.0, 0.4, 2, 3.5, *, -, * because of wrong priority
and calculates to 46.199999, which is the wrong result.
Instead of using String constants for operators it would be better to use an enum, which encapsulates the tokens and use the enum for priority calculation.
- relates to
-
JDK-8093271 "java.lang.IllegalArgumentException: Invalid expression." when parsing ${(10 * 5) - 13}
- Resolved