Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D0D31043D for ; Fri, 2 Jan 2015 22:16:34 +0000 (UTC) Received: (qmail 14065 invoked by uid 500); 2 Jan 2015 22:16:34 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 13935 invoked by uid 500); 2 Jan 2015 22:16:34 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 13783 invoked by uid 99); 2 Jan 2015 22:16:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jan 2015 22:16:34 +0000 Date: Fri, 2 Jan 2015 22:16:34 +0000 (UTC) From: "Olivier NOUGUIER (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FELIX-4745) Support for aspectj advice static method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-4745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Olivier NOUGUIER updated FELIX-4745: ------------------------------------ Attachment: 0001-FELIX-4745-naive-fix.patch 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)