Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Inject annotation in lambda

Ah yes, I guess without the rest of the program I probably failed to mark the @NonNull as TYPE_USE. Regardless AspectJ does nothing with type annotations. In fact given that some are stored at offsets in the byte code their positions will be damaged by weaving which inserts extra byte code but does not move the type annotations. No-one has noticed yet, so I guess it isn't proving a super important feature :)

Andy

On 23 September 2014 22:16, Mohan Radhakrishnan <radhakrishnan.mohan@xxxxxxxxx> wrote:
Ok. The code compiles though. I think it is legal.

Thanks,
Mohan

On Wed, Sep 24, 2014 at 10:01 AM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
Hi,

Java8 did introduce type annotations but you can't annotate the constructor reference you are annotating there (I don't think).

​There is also no support in AspectJ yet for ​matching on type annotations. In your case there you could of course put around advice on the call to toCollection().

​cheers,​

​Andy​

On 23 September 2014 02:28, Mohan Radhakrishnan <radhakrishnan.mohan@xxxxxxxxx> wrote:
Hi,
        I have used AspectJ in the past.. I came across this discussion http://mail.openjdk.java.net/pipermail/mlvm-dev/2013-January/005196.html

Does AspectJ inject behavior into an annotation like this one ?

(e.g) If I have a predicate which is annotated I can intercept the predicate and inject new behaviour.
         
Is there Java code in the compiler that deals with this ? Do you use MethodHandles for this ? 

I don't know if this is even possible using pure Java but I am interested in looking at any code that does that.

List list1 = list.
               stream().
                map(p::matcher).
                  filter(Matcher::find).map(matcher -> matcher.group()).
                      collect(Collectors.toCollection(@ NonNull ArrayList::new));

Thanks,
Mohan

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
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@xxxxxxxxxxx
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@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top