Repository: camel
Updated Branches:
  refs/heads/master 123036bb0 -> a60df1f94


Fixed potential NPE in camel-stomp


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

Branch: refs/heads/master
Commit: a60df1f94517e05eaacaefd04bbf4aaebef5c6f8
Parents: 123036b
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sat Oct 15 15:29:25 2016 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sat Oct 15 15:29:25 2016 +0200

----------------------------------------------------------------------
 .../camel/component/stomp/StompComponent.java   | 23 +-------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a60df1f9/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java
----------------------------------------------------------------------
diff --git 
a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java
 
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java
index d27c16a..3684345 100644
--- 
a/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java
+++ 
b/components/camel-stomp/src/main/java/org/apache/camel/component/stomp/StompComponent.java
@@ -27,7 +27,7 @@ public class StompComponent extends UriEndpointComponent {
     /**
      * To use the shared stomp configuration
      */
-    private StompConfiguration configuration;
+    private StompConfiguration configuration = new StompConfiguration();
 
     /**
      * The URI of the Stomp broker to connect to
@@ -69,15 +69,6 @@ public class StompComponent extends UriEndpointComponent {
         return endpoint;
     }
 
-    @Override
-    protected void doStart() throws Exception {
-        super.doStart();
-
-        if (configuration == null) {
-            configuration = new StompConfiguration();
-        }
-    }
-
     public StompConfiguration getConfiguration() {
         return configuration;
     }
@@ -93,9 +84,6 @@ public class StompComponent extends UriEndpointComponent {
      * The URI of the Stomp broker to connect to
      */
     public void setBrokerURL(String brokerURL) {
-        if (configuration == null) {
-            configuration = new StompConfiguration();
-        }
         configuration.setBrokerURL(brokerURL);
     }
 
@@ -103,9 +91,6 @@ public class StompComponent extends UriEndpointComponent {
      * The username
      */
     public void setLogin(String login) {
-        if (configuration == null) {
-            configuration = new StompConfiguration();
-        }
         configuration.setLogin(login);
     }
 
@@ -113,9 +98,6 @@ public class StompComponent extends UriEndpointComponent {
      * The password
      */
     public void setPasscode(String passcode) {
-        if (configuration == null) {
-            configuration = new StompConfiguration();
-        }
         configuration.setPasscode(passcode);
     }
     
@@ -123,9 +105,6 @@ public class StompComponent extends UriEndpointComponent {
      * The virtual host
      */
     public void setHost(String host) {
-        if (configuration == null) {
-            configuration = new StompConfiguration();
-        }
         configuration.setHost(host);
     }
 }

Reply via email to