Bug 282299 - [generics] [itds] While using intertype declaration, generic method inheritance cause compilation error
Summary: [generics] [itds] While using intertype declaration, generic method inheritan...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.6.6   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-02 11:11 EDT by John Wu CLA
Modified: 2009-07-27 17:58 EDT (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 John Wu CLA 2009-07-02 11:11:09 EDT
In the following case, the method (which is inherited from super-class/super-interfact and has generic type parameter(s)) is not recognized by the compiler or is not inherited from its super-class/super-interfact at all.

This is an issue for AspectJ 1.6.4 and 1.6.5, but not for 1.6.2 and 1.6.3.

== == ==
[INFO] Compiler errors :
error at public class Target
             ^^^^^
\Tests\itd-generic-type\src\main\java\aspectj\test\Target.java:3:0::0 The type aspectj.test.Target must implement the inherited
abstract method aspectj.test.Accessor.set(Ljava/lang/String;Ljava/lang/Object;)
        see also: \Tests\itd-generic-type\src\main\java\aspectj\test\Accessor.java:7::0
        see also: \Tests\itd-generic-type\src\main\java\aspectj\test\TargetEnhancer.aj:5::0
== == ==

public interface Accessor<V>
{
    V get(String key);

    void set(String key, V value);
}

public class AccessorImpl<V> implements Accessor<V>
{

    public V get(String key)
    {
        System.out.println("Calling get(..)");
        return null;
    }

    public void set(String key, V value)
    {
        System.out.println("Calling set(..)");
    }

}

public class Target
{
}

public aspect TargetEnhancer
{
    declare parents: Target extends AccessorImpl<String>;
}
Comment 1 Andrew Clement CLA 2009-07-27 17:58:46 EDT
the error was produced by some code that didn't realise a bridge method would satisfy the requirement.

test and fix committed. thanks for the testcase