Bug 221267

Summary: [1.5][compiler] missing annotation bindings on interface method parameter
Product: [Eclipse Project] JDT Reporter: Walter Harley <eclipse>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe_mulet
Version: 3.4   
Target Milestone: 3.4 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

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.