Bug 221267 - [1.5][compiler] missing annotation bindings on interface method parameter
Summary: [1.5][compiler] missing annotation bindings on interface method parameter
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-04 01:30 EST by Walter Harley CLA
Modified: 2008-03-27 08:17 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.32 KB, patch)
2008-03-25 08:48 EDT, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Harley CLA 2008-03-04 01:30:23 EST
When an interface extends an unresolved type, annotations on its parameters are not detected.  For instance:

  @interface A1 {}

  interface I1 extends Cloneable {
    int m1(@A1 p1);
  }

  interface I2 extends Zork {
    int m2(@A1 p2);
  }

The p1 parameter has an annotation binding to A1, but the p2 parameter does not.  The only difference is that I2 extends an unresolved type (which, presumably, causes trouble because we don't know whether m2 is an extension of a method in Zork).

I have added test Negative7 to the org.eclipse.jdt.compiler.apt.tests NegativeTests suite, to demonstrate this case.
Comment 1 Walter Harley CLA 2008-03-05 12:53:13 EST
Sorry, this should have been for CORE.
Comment 2 Philipe Mulet CLA 2008-03-25 08:48:00 EDT
Problem comes from missing annotation resolution earlier in APT usecase, which cannot be recovered later on when scope got disconnected.

It comes from the ASTVisitor not visiting type declarations if ignoreFurtherInvestigation got positionned (as consequence of an error having been reported). I think the check should be removed, and the AST still be traversed in these situations.
Comment 3 Philipe Mulet CLA 2008-03-25 08:48:43 EDT
Created attachment 93375 [details]
Proposed patch
Comment 4 Philipe Mulet CLA 2008-03-25 10:11:49 EDT
Released for 3.4M6.
Fixed
Comment 5 Philipe Mulet CLA 2008-03-27 05:12:39 EDT
Walter - can pls you verify this fix is in 3.4M6 ? (then mark it as verified)
Comment 6 Frederic Fusier CLA 2008-03-27 08:17:15 EDT
I finally verified it for 3.4M6 running APT NegativeTests suite.