Return-Path: Delivered-To: apmail-incubator-cxf-issues-archive@locus.apache.org Received: (qmail 30231 invoked from network); 30 Jan 2007 06:57:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2007 06:57:54 -0000 Received: (qmail 3117 invoked by uid 500); 30 Jan 2007 06:58:00 -0000 Delivered-To: apmail-incubator-cxf-issues-archive@incubator.apache.org Received: (qmail 3069 invoked by uid 500); 30 Jan 2007 06:58:00 -0000 Mailing-List: contact cxf-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-issues@incubator.apache.org Received: (qmail 3060 invoked by uid 99); 30 Jan 2007 06:58:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 22:58:00 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 22:57:53 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 842B47142A7 for ; Mon, 29 Jan 2007 22:57:33 -0800 (PST) Message-ID: <20359617.1170140253537.JavaMail.jira@brutus> Date: Mon, 29 Jan 2007 22:57:33 -0800 (PST) From: "Bozhong Lin (JIRA)" To: cxf-issues@incubator.apache.org Subject: [jira] Updated: (CXF-323) Improper synchronization of getDefaultBus(), setDefaultBus() In-Reply-To: <15051495.1166761641087.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bozhong Lin updated CXF-323: ---------------------------- Assignee: (was: willem Jiang) > Improper synchronization of getDefaultBus(), setDefaultBus() > ------------------------------------------------------------ > > Key: CXF-323 > URL: https://issues.apache.org/jira/browse/CXF-323 > Project: CXF > Issue Type: Bug > Reporter: Jarek Gawor > > getDefaultBus() method in org.apache.cxf.bus.spring.SpringBusFactory and org.apache.cxf.bus.cxf.CXFBusFactory is improperly synchronized. The method is instance-level synchronized while it initializes and accesses a class-level variable. Two different instances of BusFactory each calling getDefaultBus() at the same time could return two different Bus instances... > This method should either be changed to 'public static synchronized Bus getDefaultBus()' or modified as for an example: > public Bus getDefaultBus() { > return initDefaultBus(); > } > private static synchronized Bus initDefaultBus() { > if (null == defaultBus) { > defaultBus = new CXFBusImpl(); > } > return defaultBus; > } > Also, the setDefaultBus() method in both classes needs to be properly synchronized. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.