Bug 80012 - Annotations are not recongnized as extending java.lang.annotations.Annotation interface
Summary: Annotations are not recongnized as extending java.lang.annotations.Annotation...
Status: VERIFIED DUPLICATE of bug 80014
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 80088 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-02 10:01 EST by Constantine Plotnikov CLA
Modified: 2004-12-15 13:00 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Constantine Plotnikov CLA 2004-12-02 10:01:48 EST
I'm using eclipse-SDK-I20041201-win32.zip.

Annotations are not recongnized as extending java.lang.annotations.Annotation
interface. The following attribute declaration and class results in the
following errors in the problems view (as copied from problem view, except date
has been replaced from russian to english one):

Severity	Description	Resource	In Folder	Location	Creation Time
2	Bound mismatch: The generic method getAnnotation(Class<A>) of type Class<T> is
not applicable for the arguments (Class<Attr>) since the type Attr is not a
valid substitute for the bounded parameter <A extends Annotation>
TestCls3.java	test-1.5/src/test	line 5	2 Dec 2004. 20:52:25



-------- test/Attr.java ------------
package test;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface Attr {
  public int tst() default -1;
}
---- test/TestCls3.java ---
package test;
@Attr 
public class TestCls3 {
  public static void main(String args[]) {
  	Attr v = TestCls.class.getAnnotation(Attr.class);
  }
}
Comment 1 Olivier Thomann CLA 2004-12-02 15:11:23 EST
I believe this is fixed in HEAD.
I will double-check
Comment 2 Olivier Thomann CLA 2004-12-02 15:32:50 EST
The code compiles fine in latest, but due to bug 80014, v is null.
Close as duplicate of bug 80014.

*** This bug has been marked as a duplicate of 80014 ***
Comment 3 Olivier Thomann CLA 2004-12-03 10:05:30 EST
*** Bug 80088 has been marked as a duplicate of this bug. ***
Comment 4 Frederic Fusier CLA 2004-12-15 12:58:41 EST
Verified for 3.1 M4 using build I200412142000.