-
Bug
-
Resolution: Fixed
-
P2
-
None
-
b82
-
Verified
Building with latest 8-lambda-b73:
[javac] Compiling 26 source files to /home/shade/trunks/nashorn/build/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /home/shade/trunks/nashorn/src/jdk/nashorn/internal/objects/NativeString.java:600: error: replace(Object,Object,Object) in NativeString cannot implement replace(K,V,V) in Map
[javac] public static Object replace(final Object self, final Object string, final Object replacement) {
[javac] ^
[javac] overriding method is static
[javac] where K,V are type-variables:
[javac] K extends Object declared in interface Map
[javac] V extends Object declared in interface Map
[javac] 1 error
[javac] 1 warning
The reason is the addition of Map.replace() in JDK8, which clashes now with the Nashorn definition of ScriptObject implements Map<String, String>. While it works now on vanilla JDK8 builds, it will fail in future when lambda/lambda changes land in JDK8.
[javac] Compiling 26 source files to /home/shade/trunks/nashorn/build/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /home/shade/trunks/nashorn/src/jdk/nashorn/internal/objects/NativeString.java:600: error: replace(Object,Object,Object) in NativeString cannot implement replace(K,V,V) in Map
[javac] public static Object replace(final Object self, final Object string, final Object replacement) {
[javac] ^
[javac] overriding method is static
[javac] where K,V are type-variables:
[javac] K extends Object declared in interface Map
[javac] V extends Object declared in interface Map
[javac] 1 error
[javac] 1 warning
The reason is the addition of Map.replace() in JDK8, which clashes now with the Nashorn definition of ScriptObject implements Map<String, String>. While it works now on vanilla JDK8 builds, it will fail in future when lambda/lambda changes land in JDK8.