activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] git commit: AMQ-2960: Fixed potential NPE in pooled connection factory in activemq-spring when using spring-dm in OSGi. As spring-dm may call getObject before postCostruct has been called.
Date Sun, 03 Nov 2013 12:41:58 GMT
AMQ-2960: Fixed potential NPE in pooled connection factory in activemq-spring when using spring-dm
in OSGi. As spring-dm may call getObject before postCostruct has been called.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/4ddbb854
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/4ddbb854
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/4ddbb854

Branch: refs/heads/trunk
Commit: 4ddbb8546d7ca50b57213da45f3fbd021ef7fe69
Parents: d0f48b3
Author: Claus Ibsen <claus.ibsen@gmail.com>
Authored: Sun Nov 3 13:40:38 2013 +0100
Committer: Claus Ibsen <claus.ibsen@gmail.com>
Committed: Sun Nov 3 13:40:38 2013 +0100

----------------------------------------------------------------------
 .../org/apache/activemq/pool/PooledConnectionFactoryBean.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/4ddbb854/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
----------------------------------------------------------------------
diff --git a/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
b/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
index afd380f..6a9de11 100644
--- a/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
+++ b/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
@@ -185,9 +185,12 @@ public class PooledConnectionFactoryBean implements FactoryBean {
         }
     }
 
-    // FactoryBean methods
     @Override
     public Object getObject() throws Exception {
+        // in case spring-dm calls getObject before this bean has been initialized
+        if (pooledConnectionFactory == null) {
+            afterPropertiesSet();
+        }
         return pooledConnectionFactory;
     }
 


Mime
View raw message