diff options
author | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
commit | 97b8365cafc3a344a22d3980b8ed885f5c6d8357 (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/java/lang/Package.java | |
parent | c648dedbde727ca3f883bb5fd773aa4af70d3369 (diff) | |
download | gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.zip gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.gz gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.bz2 |
Merged gcj-eclipse branch to trunk.
From-SVN: r120621
Diffstat (limited to 'libjava/classpath/java/lang/Package.java')
-rw-r--r-- | libjava/classpath/java/lang/Package.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libjava/classpath/java/lang/Package.java b/libjava/classpath/java/lang/Package.java index 38bb324..1141a07 100644 --- a/libjava/classpath/java/lang/Package.java +++ b/libjava/classpath/java/lang/Package.java @@ -345,14 +345,13 @@ public class Package * <code>null</code> if no such annotation exists. * @since 1.5 */ - /* FIXME[GENERICS]: <T extends Annotation> T getAnnotation(Class <T>) */ - public Annotation getAnnotation(Class annotationClass) + public <A extends Annotation> A getAnnotation(Class<A> annotationClass) { - Annotation foundAnnotation = null; + A foundAnnotation = null; Annotation[] annotations = getAnnotations(); - for (int i = 0; i < annotations.length; i++) - if (annotations[i].annotationType() == annotationClass) - foundAnnotation = annotations[i]; + for (Annotation annotation : annotations) + if (annotation.annotationType() == annotationClass) + foundAnnotation = (A) annotation; return foundAnnotation; } @@ -406,8 +405,7 @@ public class Package * @return true if an annotation exists for the specified type. * @since 1.5 */ - /* FIXME[GENERICS]: Signature is Class<? extends Annotation> */ - public boolean isAnnotationPresent(Class + public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { return getAnnotation(annotationClass) != null; |