felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier NOUGUIER (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FELIX-4745) Support for aspectj advice static method
Date Sat, 03 Jan 2015 17:07:34 GMT

    [ https://issues.apache.org/jira/browse/FELIX-4745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14263277#comment-14263277
] 

Olivier NOUGUIER edited comment on FELIX-4745 at 1/3/15 5:06 PM:
-----------------------------------------------------------------

Naive patch to resolve (at least partially) this issues.
Don't know know what are all  the consequences of applying iPojo bytecode manipulation to
all static method like this...


was (Author: cheleb):
Naive patch to resolve (at least partially) this issues.
Don't know want are all  the consequences of applying iPojo bytecode manipulation to static
method like this.

> Support for aspectj advice static method
> ----------------------------------------
>
>                 Key: FELIX-4745
>                 URL: https://issues.apache.org/jira/browse/FELIX-4745
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.12.0
>            Reporter: Olivier NOUGUIER
>            Priority: Minor
>         Attachments: 0001-FELIX-4745-naive-fix.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When using aspectj to weave classes prior to iPojo packaging, injected advice are ignore
by iPojo bytecode manipulation.
> Then NPE are thrown in the advice because of the lazy initialization mechanism of @Requires
services.
> In my usecase, I want to weave @Transactional springframework aspect in iPojo component.

> Code generated:
> static final String updateName_aroundBody0(SignupTestDao ajc$this, String name) {
>   LOGGER.info(*ajc$this.testDao*);
>   for (Test test : *ajc$this.testDao*.findAll()) {
>     test.setName(name);
>     *ajc$this.testDao*.update(test);
>     if (name.equals("boom")) {
>       throw new RuntimeException("boom");
>     }
>   }
>   return "done";
> }
> Code expected:
> static final String updateName_aroundBody0(SignupTestDao ajc$this, String name)
> {
>   LOGGER.info(*ajc$this.__gettestDao()*);
>   for (Test test : *ajc$this.__gettestDao()*.findAll()) {
>     test.setName(name);
>     *ajc$this.__gettestDao()*.update(test);
>     if (name.equals("boom")) {
>       throw new RuntimeException("boom");
>     }
>   }
>   return "done";
> }
> A naive fix is to apply iPojo bytecode manipulation to static methods... see the patch
provided.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message