Commit e04e6ca6 authored by Nicolas Tachker's avatar Nicolas Tachker
Browse files

JORAM-255: remove a bad Connection cast on createContext method.

parent 44448f07
/* /*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging * JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies * Copyright (C) 2004 - 2016 ScalAgent Distributed Technologies
* Copyright (C) 2004 Bull SA * Copyright (C) 2004 Bull SA
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -157,7 +157,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory, ...@@ -157,7 +157,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory,
public javax.jms.JMSContext createContext() { public javax.jms.JMSContext createContext() {
try { try {
return new JMSContext((Connection) createConnection()); return new JMSContext(createConnection());
} catch (JMSSecurityException e) { } catch (JMSSecurityException e) {
logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e); logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e);
throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e); throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e);
...@@ -170,7 +170,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory, ...@@ -170,7 +170,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory,
public javax.jms.JMSContext createContext(String userName, String password) { public javax.jms.JMSContext createContext(String userName, String password) {
try { try {
return new JMSContext((Connection) createConnection(userName, password)); return new JMSContext(createConnection(userName, password));
} catch (JMSSecurityException e) { } catch (JMSSecurityException e) {
logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e); logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e);
throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e); throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e);
...@@ -182,7 +182,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory, ...@@ -182,7 +182,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory,
public javax.jms.JMSContext createContext(String userName, String password, int sessionMode) { public javax.jms.JMSContext createContext(String userName, String password, int sessionMode) {
try { try {
return new JMSContext((Connection) createConnection(userName, password), sessionMode); return new JMSContext(createConnection(userName, password), sessionMode);
} catch (JMSSecurityException e) { } catch (JMSSecurityException e) {
logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e); logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e);
throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e); throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e);
...@@ -194,7 +194,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory, ...@@ -194,7 +194,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory,
public javax.jms.JMSContext createContext(int sessionMode) { public javax.jms.JMSContext createContext(int sessionMode) {
try { try {
return new JMSContext((Connection) createConnection(), sessionMode); return new JMSContext(createConnection(), sessionMode);
} catch (JMSSecurityException e) { } catch (JMSSecurityException e) {
logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e); logger.log(BasicLevel.ERROR, "Unable to create JMSContext", e);
throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e); throw new JMSSecurityRuntimeException("Unable to create JMSContext", e.getMessage(), e);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment