Skip to content

Commit

Permalink
8194764: javac incorrectly flags deprecated for removal imports
Browse files Browse the repository at this point in the history
Summary: Fixing source range for the Source.Feature.DEPRECATE_ON_IMPORT
Reviewed-by: mcimadamore
  • Loading branch information
jlahoda committed Feb 7, 2018
1 parent e6dd8b1 commit 9d7d4cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -152,7 +152,7 @@ public enum Feature {
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),
Expand Down
3 changes: 2 additions & 1 deletion test/langtools/tools/javac/warnings/Deprecation.java
Original file line number Diff line number Diff line change
@@ -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
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9d7d4cc

Please sign in to comment.