Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 66014 invoked from network); 10 Feb 2011 10:48:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2011 10:48:27 -0000 Received: (qmail 94846 invoked by uid 500); 10 Feb 2011 10:48:24 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 93565 invoked by uid 500); 10 Feb 2011 10:48:22 -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 93534 invoked by uid 99); 10 Feb 2011 10:48:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Feb 2011 10:48:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Feb 2011 10:48:18 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id BAFA319D17A for ; Thu, 10 Feb 2011 10:47:57 +0000 (UTC) Date: Thu, 10 Feb 2011 10:47:57 +0000 (UTC) From: "Vincent Vandemeulebrouck (JIRA)" To: dev@felix.apache.org Message-ID: <1529296628.7649.1297334877747.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Created: (FELIX-2834) @Validate method is called when the @Requires components are not validated yet MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org @Validate method is called when the @Requires components are not validated yet ------------------------------------------------------------------------------ Key: FELIX-2834 URL: https://issues.apache.org/jira/browse/FELIX-2834 Project: Felix Issue Type: Bug Components: iPOJO Affects Versions: iPOJO-1.6.0 Reporter: Vincent Vandemeulebrouck Declare two components one that requires the other. Have an @Validate method. Depending on the declaration order in the metadata.xml, the component that requires the other may have acces to a component which has not been validated. Example: @Component class Component1 { @Requires Component2 c2; @Validate public void init() { // this may cause an NullPointerException, as c2.usefullData is created in the @Validate method if (c2.usefullData.length()>0) { // Do something } } } @Component class Component2 { String usefullData; @Validate public void init() { usefullData="ready"; } } If you declare this metadata.xml, the @Validate will fail: Changing the order of components in xml solves the problem, although I think the validation should be called only when the required components are validated. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira