Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 3017 invoked from network); 21 Sep 2010 08:47:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Sep 2010 08:47:57 -0000 Received: (qmail 25276 invoked by uid 500); 21 Sep 2010 08:47:56 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 25056 invoked by uid 500); 21 Sep 2010 08:47:54 -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 25048 invoked by uid 99); 21 Sep 2010 08:47:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 08:47:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 08:47:53 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8L8lWSm021114 for ; Tue, 21 Sep 2010 08:47:33 GMT Message-ID: <30663914.311731285058852517.JavaMail.jira@thor> Date: Tue, 21 Sep 2010 04:47:32 -0400 (EDT) From: "Clement Escoffier (JIRA)" To: dev@felix.apache.org Subject: [jira] Resolved: (FELIX-2603) wrong behavior of InstanceManager.onSet(..) method In-Reply-To: <32278481.293651284988292614.JavaMail.jira@thor> 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-2603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Clement Escoffier resolved FELIX-2603. -------------------------------------- Resolution: Fixed > wrong behavior of InstanceManager.onSet(..) method > -------------------------------------------------- > > Key: FELIX-2603 > URL: https://issues.apache.org/jira/browse/FELIX-2603 > Project: Felix > Issue Type: Bug > Components: iPOJO > Affects Versions: iPOJO-1.4.0 > Environment: all > Reporter: P.A > Assignee: Clement Escoffier > Fix For: iPOJO-1.8.0 > > > Hello, > Clement and I has talked about this issue, and some different point of views are welcome. > Currently, in the InstanceManager.onSet(..) method, the calls to the FieldInterceptor.onSet(..) is conditioned by '!value.equals(objectValue)', the 'value' is the current reference to the intercepted field, 'objectValue' is the reference that is going to be assigned to the intercepted field. > See line 1096 of InstanceManager.java in iPOJO core 1.6.4. > Thus, in my opinion, the semantic of 'onSet' is not really what is described in the iPOJO documentation "This method is called each time a field of the POJO is assigned" (see http://felix.apache.org/site/how-to-write-your-own-handler.html#Howtowriteyourownhandler-InteractingwiththePOJO). Its semantic is rather "this method is called each time a field of the POJO is assigned and the new assigned value is different (in the 'equals(..)' method way) from the current value". > Moreover, the call to 'equals' method can result in some expensive computations, thus this optimization can be counter productive. > I suggest to remove the condition '!value.equals(objectValue))' in 'InstanceManager.onSet(..)'. > If some external codes rely on the current behavior of onSet(..), rename the 'InstanceManager.onSet(..)' to 'InstanceManager.onModification(..)', add the method onModification(..) in FieldInterceptor interface, and adapt the external codes to use this new 'onModification(..)' method. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.