Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332457 - incorrect generics error against generic itd
Summary: incorrect generics error against generic itd
Status: RESOLVED DUPLICATE of bug 343001
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-13 12:48 EST by Andrew Clement CLA
Modified: 2011-04-26 22:01 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2010-12-13 12:48:04 EST
reported on the mailing list.  This works on the command line but fails in the IDE:

I tried to access the method from sub class. But it show compiler error. Am I doing anything working here?

public class Purchase{
}
//
aspect PurchaseFinder{
    //Compile error code
    static <U extends Purchase> U Purchase.find(){
        ......
     }
}

public class HardwarePurchase extend Purchase{
  public static test(){
     HardwarePurchase test =  HardwarePurchase .<HardwarePurchase >find();  // this code is not working 
  }
}

Error- The method find() of type Purchase is not generic; it cannot be parameterized with arguments <HardwarePurchase >.

But if I move the static function (find) code to the Purchase class from PurchaseFinder aspect then it works fine.

Working code-
public class Purchase{
     static <U extends Purchase> U find(){
        ......
     }
}
Comment 1 Andrew Clement CLA 2010-12-13 13:10:26 EST
Doh!  It is a reconciling thing.
Comment 2 Andrew Eisenberg CLA 2011-04-26 22:01:50 EDT
Same bug as what we are seeing in the Neo4J code.

*** This bug has been marked as a duplicate of bug 343001 ***