Merged gcj-eclipse branch to trunk.

From-SVN: r120621
This commit is contained in:
Tom Tromey
2007-01-09 19:58:05 +00:00
parent c648dedbde
commit 97b8365caf
17478 changed files with 606493 additions and 100744 deletions
+6 -8
View File
@@ -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;