Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » itd problems with ajdt 1.6.3
itd problems with ajdt 1.6.3 [message #72863] Sun, 11 January 2009 06:56 Go to next message
Max Meier is currently offline Max Meier
Messages: 4
Registered: July 2009
Junior Member
Hello,

i have some problems using itd with ajdt 1.6.3.

environment:

- clean install of eclipse-SDK-3.4.1-win32
- using http://download.eclipse.org/tools/ajdt/34/dev/update
installing 1.6.3.20090110234235 AJDT (JT Weaving)
installing 1.0.0.200901090822 Equinox Aspects Feature


simple test implementation:

//
package test;

public enum MyEnum {
C1, C2;
}

//
package test.mi;

public aspect MixIn1 {

public interface IMixIn1 {};

declare parents : test.mo.* implements Object;

public String IMixIn1.f11;

public void IMixIn1.m11() {
System.out.println("called m11");
};

public void IMixIn1.m12() {
System.out.println("called m12");
};

}


//
package test.mi;

public aspect MixIn2 {

public interface IMixIn2 {};

declare parents : test.mo.* implements IMixIn2;

public void IMixIn2.m21() {
System.out.println("called m21");
};

}


//
package test.mi;

import test.*;
import static test.MyEnum.*;

public aspect MixIn3 {

private static MyEnum me1 = MyEnum.C1;
private static MyEnum me2 = C2;

public interface IMixIn3 {};

declare parents : test.mo.* implements IMixIn3;

public void IMixIn3.m31() {
System.out.println(me1 + " " + me2);
};
}


//
package test.mo;

import test.mi.MixIn1.IMixIn1;
import test.mi.MixIn2.IMixIn2;
import test.mi.MixIn3.IMixIn3;

public class MixedObject implements IMixIn1, IMixIn2, IMixIn3 { }

//
package test.mo;

public class Test {

public static void main(String[] args) {

MixedObject mo = new MixedObject();

mo.m11();
mo.m12();
mo.m31();

mo.f11 = "value";

System.out.println(mo.f11);

}

}

//
package test.mo;

public class Test1 {

public static void main(String[] args) {
new Test1().m21();
new Test1().m31();
}

}

problem descriptions:

- MixIn1 with "wrong" 'implements Objects' works "fine" with weaving
method and field only into MixedObject
- MixIn2 with correct 'implements IMixIn2' weaves into all classes of
package test.mo
- MixIn3 has marker "MyEnum$C1 cannot be resolved", but works fine
- MixedObject code assist doesn't work for IMixIn* in implements clause,
List shows them but selection doesn't work
- context menu "Declared On" at "declare parents : test.mo.* implements
IMixIn2;" in MinIn2 shows Test, Test1
- no aspectj marker at "declare parents : test.mo.* implements Object;" in
MinIn1
- code works but should not, Test1 and Test2 are executable

question:

bug or my mistake ?


Thanks,
Max
Re: itd problems with ajdt 1.6.3 [message #72881 is a reply to message #72863] Sun, 11 January 2009 12:15 Go to previous messageGo to next message
Eclipse User
Originally posted by: andrew.eisenberg.springsource.com

Hi,

Yes, there are some tricky things with the new ITD aware reconciling,
especially for interfaces. We haven't yet covered all the corner cases. I
will use your classes as a test case and will have a fix in a few days.

In the meantime, you can track the progress of this bug in bugzilla:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=257437


On 11/01/09 3:56 AM, in article
c41b7ddb43bc9335929262bc17a5d061$1@www.eclipse.org, "Max Meier"
<afins_2004@yahoo.de> wrote:

> Hello,
>
> i have some problems using itd with ajdt 1.6.3.
>
> environment:
>
> - clean install of eclipse-SDK-3.4.1-win32
> - using http://download.eclipse.org/tools/ajdt/34/dev/update
> installing 1.6.3.20090110234235 AJDT (JT Weaving)
> installing 1.0.0.200901090822 Equinox Aspects Feature
>
>
> simple test implementation:
>
> //
> package test;
>
> public enum MyEnum {
> C1, C2;
> }
>
> //
> package test.mi;
>
> public aspect MixIn1 {
>
> public interface IMixIn1 {};
>
> declare parents : test.mo.* implements Object;
>
> public String IMixIn1.f11;
>
> public void IMixIn1.m11() {
> System.out.println("called m11");
> };
>
> public void IMixIn1.m12() {
> System.out.println("called m12");
> };
>
> }
>
>
> //
> package test.mi;
>
> public aspect MixIn2 {
>
> public interface IMixIn2 {};
>
> declare parents : test.mo.* implements IMixIn2;
>
> public void IMixIn2.m21() {
> System.out.println("called m21");
> };
>
> }
>
>
> //
> package test.mi;
>
> import test.*;
> import static test.MyEnum.*;
>
> public aspect MixIn3 {
>
> private static MyEnum me1 = MyEnum.C1;
> private static MyEnum me2 = C2;
>
> public interface IMixIn3 {};
>
> declare parents : test.mo.* implements IMixIn3;
>
> public void IMixIn3.m31() {
> System.out.println(me1 + " " + me2);
> };
> }
>
>
> //
> package test.mo;
>
> import test.mi.MixIn1.IMixIn1;
> import test.mi.MixIn2.IMixIn2;
> import test.mi.MixIn3.IMixIn3;
>
> public class MixedObject implements IMixIn1, IMixIn2, IMixIn3 { }
>
> //
> package test.mo;
>
> public class Test {
>
> public static void main(String[] args) {
>
> MixedObject mo = new MixedObject();
>
> mo.m11();
> mo.m12();
> mo.m31();
>
> mo.f11 = "value";
>
> System.out.println(mo.f11);
>
> }
>
> }
>
> //
> package test.mo;
>
> public class Test1 {
>
> public static void main(String[] args) {
> new Test1().m21();
> new Test1().m31();
> }
>
> }
>
> problem descriptions:
>
> - MixIn1 with "wrong" 'implements Objects' works "fine" with weaving
> method and field only into MixedObject
> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
> package test.mo
> - MixIn3 has marker "MyEnum$C1 cannot be resolved", but works fine
> - MixedObject code assist doesn't work for IMixIn* in implements clause,
> List shows them but selection doesn't work
> - context menu "Declared On" at "declare parents : test.mo.* implements
> IMixIn2;" in MinIn2 shows Test, Test1
> - no aspectj marker at "declare parents : test.mo.* implements Object;" in
> MinIn1
> - code works but should not, Test1 and Test2 are executable
>
> question:
>
> bug or my mistake ?
>
>
> Thanks,
> Max
>
Re: itd problems with ajdt 1.6.3 [message #72899 is a reply to message #72863] Sun, 11 January 2009 12:37 Go to previous messageGo to next message
Eclipse User
Originally posted by: andrew.eisenberg.springsource.com

More on this...

Most of the problems you mention have been fixed in a dev version of AJDT
put out yesterday: 1.6.3.20090110234235 (available on the 34 dev update
site).

Many of your other issues are actually not problems, but expected behavior.

There is only one thing you are seeing that is actually a but. Explanations
below.


> problem descriptions:
>
> - MixIn1 with "wrong" 'implements Objects' works "fine" with weaving
> method and field only into MixedObject
Expected.
Object is not exposed to the weaver and so even though you add a parent to
it through ITD, it does not really happen.


> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
> package test.mo
Expected

> - MixIn3 has marker "MyEnum$C1 cannot be resolved", but works fine
This is an error. It is an error in the editor, not the compiler. So, the
code works fine even though the editor shows a spurious error.


> - MixedObject code assist doesn't work for IMixIn* in implements clause,
> List shows them but selection doesn't work
Not exactly sure what you mean here. ITD methods exist in content assist
when within a method. We have not yet implemented the overriding of ITD
methods when you select Source -> Override/Implement methods...

> - context menu "Declared On" at "declare parents : test.mo.* implements
> IMixIn2;" in MinIn2 shows Test, Test1
Expected
ITDs on interfaces are not actually added to the interface because
interfaces have no implementations. Rather, they are added to the first
sub-class that implements the interface (if it is exposed to the weaver).
So, here Test and Test1 have IMixIn2.m21() declared on it even though it is
really declared on their super interface.

This may not have worked in earlier versions of AJDT. So, if this is still
giving you problems, please update to the latest dev version.


> - no aspectj marker at "declare parents : test.mo.* implements Object;" in
> MinIn1
Expected.
Again, Object not exposed to the weaver.

> - code works but should not, Test1 and Test2 are executable
The errors you see are from the editor, not the compiler. You can tell this
because you can open up the problems view and see that the errors don't
exist there. Only in the editor.


>
> question:
>
> bug or my mistake ?
>
>
> Thanks,
> Max
>
Re: itd problems with ajdt 1.6.3 [message #72917 is a reply to message #72899] Sun, 11 January 2009 20:35 Go to previous messageGo to next message
Max Meier is currently offline Max Meier
Messages: 4
Registered: July 2009
Junior Member
>> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
>> package test.mo
> Expected

To make it clear for me: MixIn2 will not only be weaved into classes
implementing the interface IMixIn2? I'm relative sure, that this works in
earlier versions (eclipse 3.3 with AJDT 1.5.4.200808131959).

For example in
http://www.eclipse.org/aspectj/doc/released/adk15notebook/at aspectj-itds.html
this would mean, that for all classes in org.xyz method getMood and field
mood were weaved in?

>> - MixedObject code assist doesn't work for IMixIn* in implements clause,
>> List shows them but selection doesn't work
> Not exactly sure what you mean here. ITD methods exist in content assist
> when within a method. We have not yet implemented the overriding of ITD
> methods when you select Source -> Override/Implement methods...

What I mean is, that if you press ctrl+space after the word implements
then the assist list appears for the IMixIn* Interface with an A icon. But
if you try to select one, it's not possible.
Re: itd problems with ajdt 1.6.3 [message #72933 is a reply to message #72917] Mon, 12 January 2009 12:37 Go to previous message
Eclipse User
Originally posted by: andrew.eisenberg.springsource.com

In the future, please use the mailing list, which has higher traffic and
better visibility than this newsgroup:
https://dev.eclipse.org/mailman/listinfo/aspectj-users


On 11/01/09 5:35 PM, in article
0eca3597cf46417a610ff3dac52306e0$1@www.eclipse.org, "Max Meier"
<afins_2004@yahoo.de> wrote:

>>> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
>>> package test.mo
>> Expected
>
> To make it clear for me: MixIn2 will not only be weaved into classes
> implementing the interface IMixIn2? I'm relative sure, that this works in
> earlier versions (eclipse 3.3 with AJDT 1.5.4.200808131959).
MixIn2 is an Aspect. Aspects are not "woven into" anything. Rather, the
declarations of an aspect may be woven into other types. In the sample code
you provided, every class in the test.mo package will implement IMixIn2.

The *declarations* of the ITDs defined on IMixIn2 will be introduced into
IMixIn2 and the *implementations* of these ITDs will be introduced into
IMixIn2's direct implementors.

This is the same compile/weaving behavior that you find in in AJDT 1.5.4.
However, the editor behavior is quite different.

>
> For example in
> http://www.eclipse.org/aspectj/doc/released/adk15notebook/at aspectj-itds.html
> this would mean, that for all classes in org.xyz method getMood and field
> mood were weaved in?
Yes.

>
>>> - MixedObject code assist doesn't work for IMixIn* in implements clause,
>>> List shows them but selection doesn't work
>> Not exactly sure what you mean here. ITD methods exist in content assist
>> when within a method. We have not yet implemented the overriding of ITD
>> methods when you select Source -> Override/Implement methods...
>
> What I mean is, that if you press ctrl+space after the word implements
> then the assist list appears for the IMixIn* Interface with an A icon. But
> if you try to select one, it's not possible.
We have not fully implemented all corner cases with ITDs and content assist.
This is something that is still in active development. The A icon is
something that will be fixed in the next dev release of AJDT (out tomorrow).

As for not being able to choose a content assist proposal after an
implements, clause, that is a bug as well. I'll look into it.
Re: itd problems with ajdt 1.6.3 [message #599480 is a reply to message #72863] Sun, 11 January 2009 12:15 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 77
Registered: July 2009
Member
Hi,

Yes, there are some tricky things with the new ITD aware reconciling,
especially for interfaces. We haven't yet covered all the corner cases. I
will use your classes as a test case and will have a fix in a few days.

In the meantime, you can track the progress of this bug in bugzilla:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=257437


On 11/01/09 3:56 AM, in article
c41b7ddb43bc9335929262bc17a5d061$1@www.eclipse.org, "Max Meier"
<afins_2004@yahoo.de> wrote:

> Hello,
>
> i have some problems using itd with ajdt 1.6.3.
>
> environment:
>
> - clean install of eclipse-SDK-3.4.1-win32
> - using http://download.eclipse.org/tools/ajdt/34/dev/update
> installing 1.6.3.20090110234235 AJDT (JT Weaving)
> installing 1.0.0.200901090822 Equinox Aspects Feature
>
>
> simple test implementation:
>
> //
> package test;
>
> public enum MyEnum {
> C1, C2;
> }
>
> //
> package test.mi;
>
> public aspect MixIn1 {
>
> public interface IMixIn1 {};
>
> declare parents : test.mo.* implements Object;
>
> public String IMixIn1.f11;
>
> public void IMixIn1.m11() {
> System.out.println("called m11");
> };
>
> public void IMixIn1.m12() {
> System.out.println("called m12");
> };
>
> }
>
>
> //
> package test.mi;
>
> public aspect MixIn2 {
>
> public interface IMixIn2 {};
>
> declare parents : test.mo.* implements IMixIn2;
>
> public void IMixIn2.m21() {
> System.out.println("called m21");
> };
>
> }
>
>
> //
> package test.mi;
>
> import test.*;
> import static test.MyEnum.*;
>
> public aspect MixIn3 {
>
> private static MyEnum me1 = MyEnum.C1;
> private static MyEnum me2 = C2;
>
> public interface IMixIn3 {};
>
> declare parents : test.mo.* implements IMixIn3;
>
> public void IMixIn3.m31() {
> System.out.println(me1 + " " + me2);
> };
> }
>
>
> //
> package test.mo;
>
> import test.mi.MixIn1.IMixIn1;
> import test.mi.MixIn2.IMixIn2;
> import test.mi.MixIn3.IMixIn3;
>
> public class MixedObject implements IMixIn1, IMixIn2, IMixIn3 { }
>
> //
> package test.mo;
>
> public class Test {
>
> public static void main(String[] args) {
>
> MixedObject mo = new MixedObject();
>
> mo.m11();
> mo.m12();
> mo.m31();
>
> mo.f11 = "value";
>
> System.out.println(mo.f11);
>
> }
>
> }
>
> //
> package test.mo;
>
> public class Test1 {
>
> public static void main(String[] args) {
> new Test1().m21();
> new Test1().m31();
> }
>
> }
>
> problem descriptions:
>
> - MixIn1 with "wrong" 'implements Objects' works "fine" with weaving
> method and field only into MixedObject
> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
> package test.mo
> - MixIn3 has marker "MyEnum$C1 cannot be resolved", but works fine
> - MixedObject code assist doesn't work for IMixIn* in implements clause,
> List shows them but selection doesn't work
> - context menu "Declared On" at "declare parents : test.mo.* implements
> IMixIn2;" in MinIn2 shows Test, Test1
> - no aspectj marker at "declare parents : test.mo.* implements Object;" in
> MinIn1
> - code works but should not, Test1 and Test2 are executable
>
> question:
>
> bug or my mistake ?
>
>
> Thanks,
> Max
>
Re: itd problems with ajdt 1.6.3 [message #599490 is a reply to message #72863] Sun, 11 January 2009 12:37 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 77
Registered: July 2009
Member
More on this...

Most of the problems you mention have been fixed in a dev version of AJDT
put out yesterday: 1.6.3.20090110234235 (available on the 34 dev update
site).

Many of your other issues are actually not problems, but expected behavior.

There is only one thing you are seeing that is actually a but. Explanations
below.


> problem descriptions:
>
> - MixIn1 with "wrong" 'implements Objects' works "fine" with weaving
> method and field only into MixedObject
Expected.
Object is not exposed to the weaver and so even though you add a parent to
it through ITD, it does not really happen.


> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
> package test.mo
Expected

> - MixIn3 has marker "MyEnum$C1 cannot be resolved", but works fine
This is an error. It is an error in the editor, not the compiler. So, the
code works fine even though the editor shows a spurious error.


> - MixedObject code assist doesn't work for IMixIn* in implements clause,
> List shows them but selection doesn't work
Not exactly sure what you mean here. ITD methods exist in content assist
when within a method. We have not yet implemented the overriding of ITD
methods when you select Source -> Override/Implement methods...

> - context menu "Declared On" at "declare parents : test.mo.* implements
> IMixIn2;" in MinIn2 shows Test, Test1
Expected
ITDs on interfaces are not actually added to the interface because
interfaces have no implementations. Rather, they are added to the first
sub-class that implements the interface (if it is exposed to the weaver).
So, here Test and Test1 have IMixIn2.m21() declared on it even though it is
really declared on their super interface.

This may not have worked in earlier versions of AJDT. So, if this is still
giving you problems, please update to the latest dev version.


> - no aspectj marker at "declare parents : test.mo.* implements Object;" in
> MinIn1
Expected.
Again, Object not exposed to the weaver.

> - code works but should not, Test1 and Test2 are executable
The errors you see are from the editor, not the compiler. You can tell this
because you can open up the problems view and see that the errors don't
exist there. Only in the editor.


>
> question:
>
> bug or my mistake ?
>
>
> Thanks,
> Max
>
Re: itd problems with ajdt 1.6.3 [message #599497 is a reply to message #72899] Sun, 11 January 2009 20:35 Go to previous message
Max Meier is currently offline Max Meier
Messages: 4
Registered: July 2009
Junior Member
>> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
>> package test.mo
> Expected

To make it clear for me: MixIn2 will not only be weaved into classes
implementing the interface IMixIn2? I'm relative sure, that this works in
earlier versions (eclipse 3.3 with AJDT 1.5.4.200808131959).

For example in
http://www.eclipse.org/aspectj/doc/released/adk15notebook/at aspectj-itds.html
this would mean, that for all classes in org.xyz method getMood and field
mood were weaved in?

>> - MixedObject code assist doesn't work for IMixIn* in implements clause,
>> List shows them but selection doesn't work
> Not exactly sure what you mean here. ITD methods exist in content assist
> when within a method. We have not yet implemented the overriding of ITD
> methods when you select Source -> Override/Implement methods...

What I mean is, that if you press ctrl+space after the word implements
then the assist list appears for the IMixIn* Interface with an A icon. But
if you try to select one, it's not possible.
Re: itd problems with ajdt 1.6.3 [message #599507 is a reply to message #72917] Mon, 12 January 2009 12:37 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 77
Registered: July 2009
Member
In the future, please use the mailing list, which has higher traffic and
better visibility than this newsgroup:
https://dev.eclipse.org/mailman/listinfo/aspectj-users


On 11/01/09 5:35 PM, in article
0eca3597cf46417a610ff3dac52306e0$1@www.eclipse.org, "Max Meier"
<afins_2004@yahoo.de> wrote:

>>> - MixIn2 with correct 'implements IMixIn2' weaves into all classes of
>>> package test.mo
>> Expected
>
> To make it clear for me: MixIn2 will not only be weaved into classes
> implementing the interface IMixIn2? I'm relative sure, that this works in
> earlier versions (eclipse 3.3 with AJDT 1.5.4.200808131959).
MixIn2 is an Aspect. Aspects are not "woven into" anything. Rather, the
declarations of an aspect may be woven into other types. In the sample code
you provided, every class in the test.mo package will implement IMixIn2.

The *declarations* of the ITDs defined on IMixIn2 will be introduced into
IMixIn2 and the *implementations* of these ITDs will be introduced into
IMixIn2's direct implementors.

This is the same compile/weaving behavior that you find in in AJDT 1.5.4.
However, the editor behavior is quite different.

>
> For example in
> http://www.eclipse.org/aspectj/doc/released/adk15notebook/at aspectj-itds.html
> this would mean, that for all classes in org.xyz method getMood and field
> mood were weaved in?
Yes.

>
>>> - MixedObject code assist doesn't work for IMixIn* in implements clause,
>>> List shows them but selection doesn't work
>> Not exactly sure what you mean here. ITD methods exist in content assist
>> when within a method. We have not yet implemented the overriding of ITD
>> methods when you select Source -> Override/Implement methods...
>
> What I mean is, that if you press ctrl+space after the word implements
> then the assist list appears for the IMixIn* Interface with an A icon. But
> if you try to select one, it's not possible.
We have not fully implemented all corner cases with ITDs and content assist.
This is something that is still in active development. The A icon is
something that will be fixed in the next dev release of AJDT (out tomorrow).

As for not being able to choose a content assist proposal after an
implements, clause, that is a bug as well. I'll look into it.
Previous Topic:itd problems with ajdt 1.6.3
Next Topic:Regarding aspectj deployment descriptor
Goto Forum:
  


Current Time: Sat Aug 23 03:36:47 EDT 2014

Powered by FUDForum. Page generated in 0.03100 seconds