diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
| commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
| tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/java/lang/Package.java | |
| parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
| download | gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz | |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
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 38bb3240de4..1141a0722ee 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; |
