Author: dkulp Date: Tue Jul 17 14:42:34 2012 New Revision: 1362517 URL: http://svn.apache.org/viewvc?rev=1362517&view=rev Log: Merged revisions 1360695 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
........ r1360695 | dkulp | 2012-07-12 10:28:46 -0400 (Thu, 12 Jul 2012) | 18 lines Merged revisions 1360673 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes ........ r1360673 | dkulp | 2012-07-12 09:47:28 -0400 (Thu, 12 Jul 2012) | 10 lines Merged revisions 1360402 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1360402 | dkulp | 2012-07-11 17:15:32 -0400 (Wed, 11 Jul 2012) | 2 lines Move thread.currentThread out of synch block. ........ ........ ........ Modified: cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java Modified: cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java?rev=1362517&r1=1362516&r2=1362517&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java (original) +++ cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java Tue Jul 17 14:42:34 2012 @@ -125,8 +125,9 @@ public abstract class BusFactory { * @param bus the default bus. */ public static void setThreadDefaultBus(Bus bus) { + Thread cur = Thread.currentThread(); synchronized (threadBusses) { - threadBusses.put(Thread.currentThread(), bus); + threadBusses.put(cur, bus); } } @@ -147,8 +148,9 @@ public abstract class BusFactory { */ public static Bus getThreadDefaultBus(boolean createIfNeeded) { Bus threadBus; + Thread cur = Thread.currentThread(); synchronized (threadBusses) { - threadBus = threadBusses.get(Thread.currentThread()); + threadBus = threadBusses.get(cur); } if (createIfNeeded && threadBus == null) { threadBus = createThreadBus(); @@ -157,12 +159,13 @@ public abstract class BusFactory { } private static synchronized Bus createThreadBus() { Bus threadBus; + Thread cur = Thread.currentThread(); synchronized (threadBusses) { - threadBus = threadBusses.get(Thread.currentThread()); + threadBus = threadBusses.get(cur); } if (threadBus == null) { threadBus = getDefaultBus(true); - threadBusses.put(Thread.currentThread(), threadBus); + threadBusses.put(cur, threadBus); } return threadBus; } @@ -194,9 +197,10 @@ public abstract class BusFactory { * @return true if the bus was not set and is now set */ public static synchronized boolean possiblySetDefaultBus(Bus bus) { + Thread cur = Thread.currentThread(); synchronized (threadBusses) { - if (threadBusses.get(Thread.currentThread()) == null) { - threadBusses.put(Thread.currentThread(), bus); + if (threadBusses.get(cur) == null) { + threadBusses.put(cur, bus); } } if (defaultBus == null) {
