Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8006557

JDK8/Lambda build clashes on Map.replace()

    XMLWordPrintable

Details

    • b82
    • Verified

    Description

      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.

      Attachments

        Activity

          People

            sundar Sundararajan Athijegannathan
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: