Re: [aspectj-users] How to get the enclosing class in a Pointcut

2017-09-26 Thread Andy Clement
If imported as a maven project the AJDT Configurator should kick in and 
configure the project correctly. Look in the project properties > builders, is 
it using AspectJ to build?

You can configure the AspectJ compiler properties to show eclipse info message 
for AspectJ weave info messages. That should tell you if it is actually 
weaving. Not sure why you need to run the ‘mvn clean compile’ in eclipse if the 
correct builder is building the project for you.  Maybe I’d like at where the 
output files are going, all to the right output folder?  If you are compile 
time weaving and not loadtime weaving running the tests should be just like for 
any other java project.

cheers,
Andy

> On Sep 25, 2017, at 9:58 PM, Mikael Petterson  
> wrote:
> 
> Hi Andy!
> 
> Yes now I got the message 
> 
> I have exactly the same code. I think it has something to do with the compile 
> and execution of my test case. I can see that ajc i done:
> 
> aspectj-maven-plugin:1.10:compile (compile_with_aspectj) @ resource-manager 
> ---
> [INFO] Showing AJC message detail for messages of types: [error, warning, 
> fail]
> [WARNING] invalid Class-Path header in manifest of jar file: 
> /repo/eraonel/.m2/repository/org/restlet/jse/org.restlet/2.3.3/org.restlet-2.3.3.jar
> invalid Class-Path header in manifest of jar file: 
> /repo/eraonel/.m2/repository/org/uncommons/maths/uncommons-maths/1.2.2a/uncommons-maths-1.2.2a.jar
> :
> 
> [INFO] Join point 'method-call(..)
> 
> However when I try to execute my test case I try to do it within Eclipse.
> I have a 'Run configuration'  for m2build making:
> 
> mvn clean compile 
> 
> Then I have another 'Run configuration', testng,  for my Demo test.
> 
> I execute it using a suite file that I have pointed out in Eclipse.
> 
> Is there anything that is different if I execute from within Eclipse?
> 
> br,
> 
> //mikael
> 
> 
>  
>  
> 
> 
> Från: Andy Clement  >
> Skickat: den 22 september 2017 16:52
> Till: Mikael Petterson
> Kopia: aspectj-users@eclipse.org 
> Ämne: Re: [aspectj-users] How to get the enclosing class in a Pointcut
>  
> Hey, hope you get this email :)
> 
> Here is a complete program:
> 
>  8<  8<  Demo.java =
> public class Demo {
>   public static void main(String []argv) {
> new Demo().test();
>   }
> 
>   public void test() {
> Node node = new Node();
> Handler handler = node.getObjectHandler();
> //getBoards() is the deprecated method.
> Boards boards = handler.getBoards();
>   }
> }
> 
> aspect X {
>   pointcut deprecatedMethods() : call(public * *(..)) && 
> @annotation(Deprecated);
>   before() : deprecatedMethods() {
> System.out.println("Caller: 
> "+thisEnclosingJoinPointStaticPart.getSignature());
> System.out.println("Called: "+thisJoinPoint.getSignature());
>   }
> }
>  8<  8<  Demo.java =
> 
> ajc -1.8 Demo.java
> java Demo
> 
> Caller: void Demo.test()
> Called: Boards Handler.getBoards()
> 
> You could use a declare warning to achieve some of this but I don't think it 
> includes the enclosing join point as a key insert right now (see declare 
> warning in https://eclipse.org/aspectj/doc/released/README-169.html 
>  ). Using declare 
> warning means you'd see the message at compile time and not runtime.
> AspectJ 1.6.9 Readme - Eclipse Oxygen 
> 
> eclipse.org 
> It is now possible to ITD member types. The syntax is as would be expected. 
> This example introduces a new member type called Inner into type Foo: public 
> class Foo ...
> 
> cheers,
> Andy
> 
> On 22 September 2017 at 05:05, Mikael Petterson  > wrote:
> Thx Any I really appreciated your help.
> 
> You where correct in your assumption:
> 
> "
> If you want to match calls *to* deprecated methods it would be more like:
> 
> call(public * *(..)) && @annotation(Deprecated)
> "
> 
> This is what I want to accomplish.
> 
> This is the structure of my maven project:
> 
> myapp
>   tests
>   nodes
> 
> In 'nodes' module I have a package called aspects where I have the aspect 
> DeprecatedMethodLogger.aj
> that I will 'weave' into the classes of nodes module.
> Under tests I have Demo class to trigger deprecated method call, getBoards(), 
> that is in nodes. This is for testing purposes. 
> Later on there will be calls not in myapp, but outside, that will make calls 
> to deprecated methods in nodes module.
> 
> Demo.java
> 
> public class Demo extends Test{
> 
> @Test
> public void test() {
>   Node node = new Node();
>   Handler handler = node.getObjectHandler();
>   //getBoards() is the deprecated method.
>   Boards boards = handler.getBoards();
>   
>  
> }
> }
> 
> 
> 

Re: [aspectj-users] Plans for 1.9.0 release

2017-09-26 Thread Andy Clement
Thanks Mario, that one is on my list.

Related to JDK9 I just released a 1.8.11 to maven central. This will be a 
little more tolerant of Java9, for some use cases it will work on JDK9 (Spring 
AOP perhaps some basic weaving).

cheers,
Andy

> On Sep 26, 2017, at 2:42 AM, Mario Ivankovits  wrote:
> 
> Hi Andy!
> 
> The ant task has a minor bug.
> 
> The COMPLIANCE_INPUTS for 1.9 is missing the minus sign.
> Without that it is not possible to configure the compliance level and the 
> error
> [ant:iajc] [error   0]: error Compliance level '1.4' is incompatible with 
> target level '9'. A compliance level '9' or better is required
> shows up.
> 
> With this fix and the compliance configuration on the ant task I was able to 
> build our project and it seems to work as expected.
> 
> 
> Index: taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
> IDEA additional info:
> Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
> <+>UTF-8
> ===
> --- taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java(revision 
> d159d8d96ba83edca8ca7aefdd1ad785912f9164)
> +++ taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java(revision )
> @@ -255,7 +255,7 @@
> 
> static final String[] TARGET_INPUTS = new String[] { "1.1", "1.2", 
> "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9" };
> static final String[] SOURCE_INPUTS = new String[] { "1.3", "1.4", 
> "1.5", "1.6", "1.7", "1.8", "1.9" };
> -   static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", 
> "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "1.9" };
> +   static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", 
> "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9" };
> 
> private static final ICommandEditor COMMAND_EDITOR;
> 
> 
> 
> 
>> Am 25.09.2017 um 19:00 schrieb Andy Clement > >:
>> 
>> Hey,
>> 
>> 1.9.0.BETA-7 is actually there now (spring milestones maven repo), published 
>> last night.This includes:
>> - update to latest JDT compiler
>> - Compilation/weaving performance on Java 9 now similar to Java8.
>> 
>> I am trying to get to an RC very soon but there are a few more things I must 
>> do before I consider it good enough, my rough target is end of the week but 
>> it depends on how many distractions I get :)
>> 
>> > right now 1.8.10 version doesn't work in such projects.
>> 
>> It would be helpful for anyone/everyone to share any issues you have with 
>> the 1.9 betas so I can make sure I have them on the TODO list, email here or 
>> bugzilla issues are fine.
>> 
>> many thanks,
>> Andy
>> 
>> 
>> On 23 September 2017 at 01:25, Krzysztof Krason > > wrote:
>> Hello,
>> Is there a plan for releasing 1.9.0 version soon? I see that there is a 
>> 1.9.0.BETA-6 in Spring Milestones maven repo and I'm wondering if you have 
>> some plans on releasing it to maven central or creating 1.9.0 and releasing 
>> it there?
>> 
>> This would greatly help with projects that want to use Java 9 and AspectJ, 
>> right now 1.8.10 version doesn't work in such projects.
>> 
>> Regards,
>> Krzysztof Krason
>> 
>> 
>> ___
>> aspectj-users mailing list
>> aspectj-users@eclipse.org 
>> To change your delivery options, retrieve your password, or unsubscribe from 
>> this list, visit
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users 
>> 
>> 
>> ___
>> aspectj-users mailing list
>> aspectj-users@eclipse.org 
>> To change your delivery options, retrieve your password, or unsubscribe from 
>> this list, visit
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> ___
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: [aspectj-users] Plans for 1.9.0 release

2017-09-26 Thread Mario Ivankovits
Hi Andy!

The ant task has a minor bug.

The COMPLIANCE_INPUTS for 1.9 is missing the minus sign.
Without that it is not possible to configure the compliance level and the error
[ant:iajc] [error   0]: error Compliance level '1.4' is incompatible with 
target level '9'. A compliance level '9' or better is required
shows up.

With this fix and the compliance configuration on the ant task I was able to 
build our project and it seems to work as expected.


Index: taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===
--- taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java(revision 
d159d8d96ba83edca8ca7aefdd1ad785912f9164)
+++ taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java(revision )
@@ -255,7 +255,7 @@

static final String[] TARGET_INPUTS = new String[] { "1.1", "1.2", 
"1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9" };
static final String[] SOURCE_INPUTS = new String[] { "1.3", "1.4", 
"1.5", "1.6", "1.7", "1.8", "1.9" };
-   static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", 
"-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "1.9" };
+   static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", 
"-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9" };

private static final ICommandEditor COMMAND_EDITOR;




Am 25.09.2017 um 19:00 schrieb Andy Clement 
>:

Hey,

1.9.0.BETA-7 is actually there now (spring milestones maven repo), published 
last night.This includes:
- update to latest JDT compiler
- Compilation/weaving performance on Java 9 now similar to Java8.

I am trying to get to an RC very soon but there are a few more things I must do 
before I consider it good enough, my rough target is end of the week but it 
depends on how many distractions I get :)

> right now 1.8.10 version doesn't work in such projects.

It would be helpful for anyone/everyone to share any issues you have with the 
1.9 betas so I can make sure I have them on the TODO list, email here or 
bugzilla issues are fine.

many thanks,
Andy


On 23 September 2017 at 01:25, Krzysztof Krason 
> wrote:
Hello,
Is there a plan for releasing 1.9.0 version soon? I see that there is a 
1.9.0.BETA-6 in Spring Milestones maven repo and I'm wondering if you have some 
plans on releasing it to maven central or creating 1.9.0 and releasing it there?

This would greatly help with projects that want to use Java 9 and AspectJ, 
right now 1.8.10 version doesn't work in such projects.

Regards,
Krzysztof Krason


___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users