8188023: Avoid -source and -target javac options in nashorn ant compilation
authorsundar
Wed, 27 Sep 2017 18:40:37 +0530
changeset 47277 69c3639a49a6
parent 47276 bfa048898f11
child 47278 9422f1314557
8188023: Avoid -source and -target javac options in nashorn ant compilation Reviewed-by: jlaskey, hannesw
make/nashorn/build.xml
make/nashorn/buildtools/nasgen/project.properties
make/nashorn/buildtools/nashorntask/project.properties
make/nashorn/project.properties
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Source.java
test/nashorn/src/jdk/nashorn/test/models/ClassWithFinalFinalizer.java
--- a/make/nashorn/build.xml	Wed Sep 27 14:56:19 2017 +0200
+++ b/make/nashorn/build.xml	Wed Sep 27 18:40:37 2017 +0530
@@ -174,8 +174,6 @@
   <target name="compile" depends="prepare" description="Compiles nashorn">
     <javac srcdir="${dynalink.module.src.dir}"
            destdir="${dynalink.module.classes.dir}"
-           source="${javac.source}"
-           target="${javac.target}"
            debug="${javac.debug}"
            encoding="${javac.encoding}"
            includeantruntime="false" fork="true">
@@ -190,8 +188,6 @@
     </delete>
     <javac srcdir="${nashorn.module.src.dir}"
            destdir="${nashorn.module.classes.dir}"
-           source="${javac.source}"
-           target="${javac.target}"
            debug="${javac.debug}"
            encoding="${javac.encoding}"
            includeantruntime="false" fork="true">
@@ -207,8 +203,6 @@
     </delete>
     <javac srcdir="${nashorn.shell.module.src.dir}"
            destdir="${nashorn.shell.module.classes.dir}"
-           source="${javac.source}"
-           target="${javac.target}"
            debug="${javac.debug}"
            encoding="${javac.encoding}"
            includeantruntime="false" fork="true">
@@ -342,8 +336,6 @@
     <javac srcdir="${test.src.dir}"
            destdir="${build.test.classes.dir}"
            classpath="${javac.test.classpath}"
-           source="${javac.source}"
-           target="${javac.target}"
            debug="${javac.debug}"
            encoding="${javac.encoding}"
            includeantruntime="false" fork="true">
@@ -351,7 +343,7 @@
         <compilerarg value="-Xlint:unchecked"/>
         <compilerarg value="-Xlint:deprecation"/>
         <compilerarg value="-Xdiags:verbose"/>
-        <compilerarg line="${test.module.imports}"/>
+        <compilerarg line="${test.module.imports.compile.time}"/>
     </javac>
 
     <copy todir="${build.test.classes.dir}/META-INF/services">
--- a/make/nashorn/buildtools/nasgen/project.properties	Wed Sep 27 14:56:19 2017 +0200
+++ b/make/nashorn/buildtools/nasgen/project.properties	Wed Sep 27 18:40:37 2017 +0530
@@ -24,8 +24,6 @@
 
 # source and target levels
 build.compiler=modern
-javac.source=1.7
-javac.target=1.7
 
 # This directory is removed when the project is cleaned:
 nasgen.build.dir=../../../../build/nashorn/nasgen
--- a/make/nashorn/buildtools/nashorntask/project.properties	Wed Sep 27 14:56:19 2017 +0200
+++ b/make/nashorn/buildtools/nashorntask/project.properties	Wed Sep 27 18:40:37 2017 +0530
@@ -24,8 +24,6 @@
 
 # source and target levels
 build.compiler=modern
-javac.source=1.8
-javac.target=1.8
 
 # This directory is removed when the project is cleaned:
 nashorntask.build.dir=../../../../build/nashorn/nashorntask
--- a/make/nashorn/project.properties	Wed Sep 27 14:56:19 2017 +0200
+++ b/make/nashorn/project.properties	Wed Sep 27 18:40:37 2017 +0530
@@ -32,8 +32,6 @@
 
 # source and target levels
 build.compiler=modern
-javac.source=1.9
-javac.target=1.9
 
 javadoc.option=\
     -tag "implSpec:a:Implementation Requirements:" \
@@ -146,7 +144,7 @@
     ${file.reference.bsh.jar}${path.separator}\
     ${file.reference.snakeyaml.jar}
 
-test.module.imports=\
+test.module.imports.compile.time=\
     --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED \
     --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED \
     --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED \
@@ -159,7 +157,10 @@
     --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED \
     --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED \
     --add-exports jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED \
-    --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
+    --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
+
+test.module.imports.runtime=\
+    ${test.module.imports.compile.time} \
     --add-opens jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED \
     --add-opens jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED
 
@@ -359,7 +360,7 @@
 
 run.test.jvmargs.common=\
   -server \
-  ${test.module.imports} \
+  ${test.module.imports.runtime} \
   ${run.test.jvmargs.external} \
   --add-modules jdk.scripting.nashorn.shell \
   ${nashorn.override.option} \
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Source.java	Wed Sep 27 14:56:19 2017 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Source.java	Wed Sep 27 18:40:37 2017 +0530
@@ -336,6 +336,7 @@
             }
         }
 
+        @SuppressWarnings("try")
         protected void loadMeta() throws IOException {
             if (length == 0 && lastModified == 0) {
                 final URLConnection c = url.openConnection();
--- a/test/nashorn/src/jdk/nashorn/test/models/ClassWithFinalFinalizer.java	Wed Sep 27 14:56:19 2017 +0200
+++ b/test/nashorn/src/jdk/nashorn/test/models/ClassWithFinalFinalizer.java	Wed Sep 27 18:40:37 2017 +0530
@@ -28,6 +28,7 @@
 @SuppressWarnings("javadoc")
 public class ClassWithFinalFinalizer {
     @Override
+    @SuppressWarnings("deprecation")
     protected final void finalize() {
         //empty
     }