Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] compilation error with generics (possible bug?)

Although .... I just tried it against HEAD and it doesn't fail like
you describe, it fails in a different way :)  So i'll still take a bug
and fix it asap.

Andy.

On 14/11/05, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> Looks like a bug to me - please can you raise it?
>
> Andy.
>
> On 14/11/05, Alexandru Popescu <the.mindstorm.mailinglist@xxxxxxxxx> wrote:
> > Hi!
> >
> > The following code seems correct to me:
> >
> > [code]
> > public interface Identifiable<T> {
> >    T getId();
> >
> >    void setId(T t);
> > }
> >
> > public interface LongIdentifiable extends Identifiable<Long> {
> > }
> >
> > public class Bean implements LongIdentifiable {
> >
> >    public Long getId() {
> >      return null;
> >    }
> >
> >    public void setId(Long t) {
> >    }
> >
> > }
> > [/code]
> >
> > at least it compiles oke with Eclipse 3.1.1.
> >
> > Going back to AspectJ and AJDT adding the following aspect:
> >
> > [code]
> > public aspect IdentifiableAspect {
> >      declare parents: Bean implements LongIdentifiable;
> >
> >      private Long LongIdentifiable.m_id;
> >
> >      public Long LongIdentifiable.getId() {
> >          return m_id;
> >      }
> >
> >      public void LongIdentifiable.setId(Long id) {
> >          m_id= id;
> >      }
> > }
> > [/code]
> >
> > results in 3 compilation errors:
> >
> > Severity        Description     Resource        In Folder       Location        Creation Time   Id
> > 2       can't override java.lang.Long org.noco.generics.LongIdentifiable.getId() with java.lang.Object
> > org.noco.generics.Bean.getId() return types don't match IdentifiableAspect.aj
> > aj5_examples/src/main/org/noco/generics line 8  November 14, 2005 3:01:43 PM    27085
> >
> > Severity        Description     Resource        In Folder       Location        Creation Time   Id
> > 2       The return type is incompatible with org.noco.generics.Identifiable<java.lang.Long>.getId()
> > Bean.java       aj5_examples/src/main/org/noco/generics line 1  November 14, 2005 3:01:43 PM    27094
> >
> > Severity        Description     Resource        In Folder       Location        Creation Time   Id
> > 2       can't override java.lang.Long org.noco.generics.LongIdentifiable.getId() with java.lang.Object
> > org.noco.generics.Bean.getId() return types don't match Bean.java
> > aj5_examples/src/main/org/noco/generics line 1  November 14, 2005 3:01:43 PM    27095
> >
> >
> > Env:
> >
> > Eclipse 3.1.1
> > AJDT: ajdt_1.3.0.20051108143751_archive.zip
> >
> > Am I doing something wrong? Is this a known bug?
> >
> > thanks in avdance,
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
>


Back to the top