summaryrefslogtreecommitdiff
path: root/qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2014-08-25 15:12:10 +0000
committerRobert Godfrey <rgodfrey@apache.org>2014-08-25 15:12:10 +0000
commit78a00e2a3a1bbc7486de0fad72603617958062c3 (patch)
tree75526f90e858d5cc3f8d228e4e1c3c42c7808a10 /qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java
parent0ed130958f49a4d4cc5307c6d6f00d04da5f834d (diff)
downloadqpid-python-78a00e2a3a1bbc7486de0fad72603617958062c3.tar.gz
Merging from trunk r1617322:1617736 in the Java tree
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.30@1620337 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java')
-rw-r--r--qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java b/qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java
index b94c672133..670f358a26 100644
--- a/qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java
+++ b/qpid/java/amqp-1-0-client-jms/example/src/main/java/org/apache/qpid/amqp_1_0/jms/example/Hello.java
@@ -20,6 +20,7 @@
*/
package org.apache.qpid.amqp_1_0.jms.example;
+import java.io.InputStream;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -51,11 +52,11 @@ public class Hello
private void runExample()
{
- try
+ try(InputStream propertiesStream = getClass().getResourceAsStream("hello.properties"))
{
- // Read the hello.properties JNDI properties file and use contents to create the InitialContext.
Properties properties = new Properties();
- properties.load(getClass().getResourceAsStream("hello.properties"));
+ // Read the hello.properties JNDI properties file and use contents to create the InitialContext.
+ properties.load(propertiesStream);
Context context = new InitialContext(properties);
// Alternatively, JNDI information can be supplied by setting the "java.naming.factory.initial"
// system property to value "org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory"