8194764: javac incorrectly flags deprecated for removal imports jdk-10+43
authorjlahoda
Wed, 07 Feb 2018 16:49:24 +0100
changeset 48776 107413b070b9
parent 48775 7c59727b4890
child 48777 c2aec276d36a
8194764: javac incorrectly flags deprecated for removal imports Summary: Fixing source range for the Source.Feature.DEPRECATE_ON_IMPORT Reviewed-by: mcimadamore
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
test/langtools/tools/javac/warnings/Deprecation.java
test/langtools/tools/javac/warnings/Deprecation.lintDeprecation.out
test/langtools/tools/javac/warnings/Deprecation.lintDeprecation8.out
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Wed Feb 07 09:18:13 2018 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java	Wed Feb 07 16:49:24 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@
         BINARY_LITERALS(JDK7, Fragments.FeatureBinaryLit, DiagKind.PLURAL),
         UNDERSCORES_IN_LITERALS(JDK7, Fragments.FeatureUnderscoreLit, DiagKind.PLURAL),
         STRINGS_IN_SWITCH(JDK7, Fragments.FeatureStringSwitch, DiagKind.PLURAL),
-        DEPRECATION_ON_IMPORT(MIN, JDK9),
+        DEPRECATION_ON_IMPORT(MIN, JDK8),
         SIMPLIFIED_VARARGS(JDK7),
         OBJECT_TO_PRIMITIVE_CAST(JDK7),
         ENFORCE_THIS_DOT_INIT(JDK7),
--- a/test/langtools/tools/javac/warnings/Deprecation.java	Wed Feb 07 09:18:13 2018 +0100
+++ b/test/langtools/tools/javac/warnings/Deprecation.java	Wed Feb 07 16:49:24 2018 +0100
@@ -1,8 +1,9 @@
 /**
  * @test  /nodynamiccopyright/
- * @bug 4986256 6598104 8032211
+ * @bug 4986256 6598104 8032211 8194764
  * @compile/ref=Deprecation.noLint.out                                                 -XDrawDiagnostics Deprecation.java
  * @compile/ref=Deprecation.lintDeprecation.out  -Xlint:deprecation                    -XDrawDiagnostics Deprecation.java
+ * @compile/ref=Deprecation.lintDeprecation.out  -Xlint:deprecation,-options -source 9 -XDrawDiagnostics Deprecation.java
  * @compile/ref=Deprecation.lintDeprecation8.out -Xlint:deprecation,-options -source 8 -XDrawDiagnostics Deprecation.java
  */
 
--- a/test/langtools/tools/javac/warnings/Deprecation.lintDeprecation.out	Wed Feb 07 09:18:13 2018 +0100
+++ b/test/langtools/tools/javac/warnings/Deprecation.lintDeprecation.out	Wed Feb 07 16:49:24 2018 +0100
@@ -1,3 +1,3 @@
-Deprecation.java:20:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
-Deprecation.java:57:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
+Deprecation.java:21:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
+Deprecation.java:58:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
 2 warnings
--- a/test/langtools/tools/javac/warnings/Deprecation.lintDeprecation8.out	Wed Feb 07 09:18:13 2018 +0100
+++ b/test/langtools/tools/javac/warnings/Deprecation.lintDeprecation8.out	Wed Feb 07 16:49:24 2018 +0100
@@ -1,4 +1,4 @@
-Deprecation.java:9:15: compiler.warn.has.been.deprecated: java.io.StringBufferInputStream, java.io
-Deprecation.java:20:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
-Deprecation.java:57:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
+Deprecation.java:10:15: compiler.warn.has.been.deprecated: java.io.StringBufferInputStream, java.io
+Deprecation.java:21:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
+Deprecation.java:58:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
 3 warnings