6908218: java.lang.Deprecated should have explicit @Target meta-annotation

Reviewed-by: mernst
This commit is contained in:
Joe Darcy 2010-01-14 20:05:19 -08:00
parent 74703b4493
commit 738b0c0ec7
2 changed files with 3 additions and 2 deletions

View File

@ -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 @@ import java.lang.annotation.*;
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(value={CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
public @interface Deprecated {
}

View File

@ -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 @@ import static java.lang.annotation.ElementType.*;
* @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 {
/**