changeset 4672:ca386fa28a62

6908218: java.lang.Deprecated should have explicit @Target meta-annotation. Reviewed-by: mernst
author darcy
date Thu, 14 Jan 2010 20:05:19 -0800
parents 568f212d297d
children e842c85ac8f4
files jdk/src/share/classes/java/lang/Deprecated.java jdk/src/share/classes/java/lang/SuppressWarnings.java
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/java/lang/Deprecated.java	Tue Jan 12 15:19:24 2010 -0800
+++ b/jdk/src/share/classes/java/lang/Deprecated.java	Thu Jan 14 20:05:19 2010 -0800
@@ -26,6 +26,7 @@
 package java.lang;
 
 import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
 
 /**
  * A program element annotated @Deprecated is one that programmers
@@ -38,5 +39,6 @@
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
+@Target(value={CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
 public @interface Deprecated {
 }
--- a/jdk/src/share/classes/java/lang/SuppressWarnings.java	Tue Jan 12 15:19:24 2010 -0800
+++ b/jdk/src/share/classes/java/lang/SuppressWarnings.java	Thu Jan 14 20:05:19 2010 -0800
@@ -26,7 +26,6 @@
 package java.lang;
 
 import java.lang.annotation.*;
-import java.lang.annotation.ElementType;
 import static java.lang.annotation.ElementType.*;
 
 /**
@@ -45,7 +44,7 @@
  * @since 1.5
  * @author Josh Bloch
  */
-@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, TYPE_PARAMETER})
 @Retention(RetentionPolicy.SOURCE)
 public @interface SuppressWarnings {
     /**