Source:
<code>private Destination createDestination(Session session, String destinationName) throws JMSConnectorException { Destination destination = null; try { if (this.destinationType.equals(JMSConstants.JMSDestinationType.QUEUE)) { destination = JMSUtils.lookupDestination(ctx, destinationName, JMSConstants.DESTINATION_TYPE_QUEUE); } else if (this.destinationType.equals(JMSConstants.JMSDestinationType.TOPIC)) { destination = JMSUtils.lookupDestination(ctx, destinationName, JMSConstants.DESTINATION_TYPE_TOPIC); } } catch (NameNotFoundException e) { if (logger.isDebugEnabled()) { logger.debug("Could not find destination '" + destinationName + "' on connection factory for '" + this.connectionFactoryString + "'. " + e.getMessage()); logger.debug("Creating destination '" + destinationName + "' on connection factory for '" + this.connectionFactoryString + "."); } try { <START> if (this.destinationType.equals(JMSConstants.JMSDestinationType.QUEUE)) { <END> destination = session.createQueue(destinationName); } else if (this.destinationType.equals(JMSConstants.JMSDestinationType.TOPIC)) { destination = session.createTopic(destinationName); } if (logger.isDebugEnabled()) { logger.debug("Created '" + destinationName + "' on connection factory for '" + this.connectionFactoryString + "'."); } } catch (JMSException e1) { throw new JMSConnectorException( "Could not find nor create '" + destinationName + "' on connection factory for " + this.connectionFactoryString, e1); } } catch (NamingException e) { throw new JMSConnectorException( "Naming exception while looking up for the destination name " + destinationName, e); } return destination; }</code><technical_language>This produce NPE. Please change this if condition other (i.e SomeConstant equals actual value)</technical_language>

Target:
private Destination createDestination(Session session, String destinationName) throws JMSConnectorException { Destination destination = null; try { if (JMSConstants.JMSDestinationType.QUEUE.equals(this.destinationType)) { destination = JMSUtils.lookupDestination(ctx, destinationName, JMSConstants.DESTINATION_TYPE_QUEUE); } else if (JMSConstants.JMSDestinationType.TOPIC.equals(this.destinationType)) { destination = JMSUtils.lookupDestination(ctx, destinationName, JMSConstants.DESTINATION_TYPE_TOPIC); } } catch (NameNotFoundException e) { if (logger.isDebugEnabled()) { logger.debug("Could not find destination '" + destinationName + "' on connection factory for '" + this.connectionFactoryString + "'. " + e.getMessage()); logger.debug("Creating destination '" + destinationName + "' on connection factory for '" + this.connectionFactoryString + "."); } try { if (JMSConstants.JMSDestinationType.QUEUE.equals(this.destinationType)) { destination = session.createQueue(destinationName); } else if (JMSConstants.JMSDestinationType.TOPIC.equals(this.destinationType)) { destination = session.createTopic(destinationName); } if (logger.isDebugEnabled()) { logger.debug("Created '" + destinationName + "' on connection factory for '" + this.connectionFactoryString + "'."); } } catch (JMSException e1) { throw new JMSConnectorException( "Could not find nor create '" + destinationName + "' on connection factory for " + this.connectionFactoryString, e1); } } catch (NamingException e) { throw new JMSConnectorException( "Naming exception while looking up for the destination name " + destinationName, e); } return destination; }