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?)

#: Andy Clement changed the world a bit at a time by saying on  11/15/2005 6:15 PM :#
I've just committed the fix for this second problem - it will be in
the next dev build.

Andy.


Probably it would be the time to start building AspectJ and maybe AJDT by myself :-).
But it still results in 3 errors.

Here is what I've done:

1/ cvs update, resulted in

[log]
[20051115-1854]
? aspectj-attic/bin
P loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
P loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java
P loadtime/src/org/aspectj/weaver/loadtime/IWeavingContext.java
P loadtime/src/org/aspectj/weaver/loadtime/Options.java
P loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
P loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java
P org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
P org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java
P org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java
P org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java
P org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java
U org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java
P org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/ASTVisitorTest.java
P org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java
P runtime/src/org/aspectj/runtime/reflect/StringMaker.java
P testing/newsrc/org/aspectj/testing/RunSpec.java
U tests/bugs150/pr115235.aj
U tests/bugs150/pr115235b.aj
U tests/bugs150/pr113447/PR113447.java
U tests/bugs150/pr113447/PR113447a.java
U tests/bugs150/pr113447/PR113447b.java
U tests/bugs150/pr113447/PR113447c.java
U tests/bugs150/pr113447/PR113447d.java
U tests/bugs150/pr113447/PR113447e.java
U tests/bugs150/pr114436/ConcreteSimpleTracing.aj
U tests/bugs150/pr114436/SimpleTrace.aj
U tests/bugs150/pr114436/TestClass.java
U tests/bugs150/pr115788/AAA.java
U tests/java5/generics/binaryBridging/ThreeA.java
U tests/java5/generics/binaryBridging/ThreeB.java
U tests/java5/generics/binaryBridging/ThreeX.java
U tests/java5/generics/binaryBridging/TwoA.java
U tests/java5/generics/binaryBridging/TwoB.java
U tests/java5/generics/binaryBridging/TwoX.java
P tests/java5/generics/binaryBridging/readme.txt
U tests/java5/generics/bugs/lists/Bean.java
U tests/java5/generics/bugs/lists/Identifiable.java
U tests/java5/generics/bugs/lists/IdentifiableAspect.java
U tests/java5/generics/bugs/lists/LongIdentifiable.java
U tests/ltw/AbstractAspect.aj
U tests/ltw/AbstractSuperAspect.aj
P tests/ltw/Main.java
U tests/ltw/TestITDMethod.java
U tests/ltw/TestMain.java
U tests/ltw/aop-abstractaspect.xml
U tests/ltw/aop-aspectsinclude.xml
U tests/ltw/aop-aspectsincludewithlintwarning.xml
U tests/ltw/aop-defineaspect.xml
U tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
P tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
U tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
P tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
P tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml
P tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
P weaver/src/org/aspectj/weaver/ConcreteTypeMunger.java
P weaver/src/org/aspectj/weaver/Lint.java
P weaver/src/org/aspectj/weaver/PerObjectInterfaceTypeMunger.java
P weaver/src/org/aspectj/weaver/ResolvedType.java
P weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java
P weaver/src/org/aspectj/weaver/TypeFactory.java
P weaver/src/org/aspectj/weaver/UnresolvedType.java
P weaver/src/org/aspectj/weaver/XlintDefault.properties
P weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
U weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
P weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
P weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
P weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java
P weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java
P weaver/src/org/aspectj/weaver/patterns/ExposedState.java
P weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
P weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java
P weaver/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java
P weaver/src/org/aspectj/weaver/patterns/Pointcut.java
P weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java
P weaver/src/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java
P weaver/src/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java
P weaver/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java
P weaver/src/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java
P weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
[/log]

2/ customize org.aspectj\modules\build\local.properties to

build.version=DEVELOPMENT
build.version.base=1.5
build.version.long=DEVELOPMENT
build.version.short=DEVELOPMENT
java14.home=c:/java/jdks/j2sdk1.4.2_09
java15.home=c:/java/jdks/jdk1.5.0_05

3/ run ant in org.aspectj\modules\build\

4/ copied the jars from (inside) aj-build\dist\aspectj-DEVELOPMENT.jar over my aspectj installation lib jars

5/ run from command line:

d:\workspace\java\research\aj5_examples\src\main>d:\java\progs\aspectj1.5dev\bin\ajc -sourceroots org\noco\generics -source 1.5 -target 1.5 -d ..\..\build\classes

D:\workspace\java\research\aj5_examples\src\main\org\noco\generics\IdentifiableAspect.aj:8 [error] 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

D:\workspace\java\research\aj5_examples\src\main\org\noco\generics\Bean.java:1 [error] The return type is incompatible with org.noco.generics.Identifiable<java.lang.Long>.getId()
(no source information available)
D:\workspace\java\research\aj5_examples\src\main\org\noco\generics\Bean.java:1 [error] 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
(no source information available)

3 errors

6/ Questions:
- the CVS isn't updated immediately or does it work rather like the SF CVS which is updated after a few hours
- why there is "no source information available" reported in the error?

./alex
--
.w( the_mindstorm )p.


On 15/11/05, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
The original program you posted blew up at compile time - which I
fixed.  But I've just modified your code to do something (added a
main) and can confirm the code it now produces blows up as you
describe - i'll take a look.

/sigh

Andy.


On 15/11/05, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> This dev build has not gone into an AJDT yet - I can't confirm whether
> jars from the dev build are currently compatible with AJDT.  Does your
> program at least compile OK on the command line using the dev build?
>
> Andy.
>
>
> On 15/11/05, Alexandru Popescu <the.mindstorm.mailinglist@xxxxxxxxx> wrote:
> > #: Alexandru Popescu changed the world a bit at a time by saying on  11/15/2005 5:09 PM :#
> > > #: Andy Clement changed the world a bit at a time by saying on  11/14/2005 9:38 PM :#
> > >> dont worry, i've already fixed it.
> > >>
> > >
> > > Andy do you know if the fix went into aspectj-DEVELOPMENT-20051115132507.jar?
> > >
> > > I have this dev build jars replaced in the AJDT and after a clean and rebuild I am still seeing the
> > > same errors.
> > >
> > > ./alex
> > > --
> > > .w( the_mindstorm )p.
> > >
> >
> > The Cross References view was correctly displaying the info, so I thought I should give it a try.
> > But this resulted in
> >
> > [stack]
> > java.lang.ClassFormatError: Method getId in class org/noco/generics/LongIdentifiable has illegal
> > modifiers: 0x241
> >         at java.lang.ClassLoader.defineClass1(Native Method)
> >         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> >         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> >         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> >         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> >         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> >         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> >         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
> >         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> >         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> > [/stack]
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >
> > >> On 14/11/05, Alexandru Popescu <the.mindstorm.mailinglist@xxxxxxxxx> wrote:
> > >>> #: Andy Clement changed the world a bit at a time by saying on  11/14/2005 4:04 PM :#
> > >>> > 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.
> > >>> >
> > >>>
> > >>> Though not clear who will rais the bug :-).
> > >>>
> > >>> ./alex
> > >>> --
> > >>> .w( the_mindstorm )p.
> > >>>
> > >>> > 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
> > >>> >> >
> > >>> >>
> > >>> > _______________________________________________
> > >>> > aspectj-users mailing list
> > >>> > aspectj-users@xxxxxxxxxxx
> > >>> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >>> >
> > >>>
> > >>> _______________________________________________
> > >>> aspectj-users mailing list
> > >>> aspectj-users@xxxxxxxxxxx
> > >>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >>>
> > >> _______________________________________________
> > >> aspectj-users mailing list
> > >> aspectj-users@xxxxxxxxxxx
> > >> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >>
> > >>
> > >>
> > >>
> > >> !DSPAM:4378e7ed615971035271540!
> > >>
> > >>
> > >
> > > _______________________________________________
> > > aspectj-users mailing list
> > > aspectj-users@xxxxxxxxxxx
> > > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
>

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top