Remove hard-coded pacakge values. Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/8ce73c67 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/8ce73c67 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/8ce73c67
Branch: refs/heads/master Commit: 8ce73c67c876f9fbb82c73035b2be8d4071f01d5 Parents: 639ea80 Author: Timothy Bish <tabish...@gmail.com> Authored: Tue Feb 3 14:33:39 2015 -0500 Committer: Timothy Bish <tabish...@gmail.com> Committed: Tue Feb 3 14:33:39 2015 -0500 ---------------------------------------------------------------------- .../main/java/org/apache/qpid/jms/JmsConnectionMetaData.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8ce73c67/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionMetaData.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionMetaData.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionMetaData.java index 024fcdf..1be96af 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionMetaData.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionMetaData.java @@ -44,7 +44,7 @@ public final class JmsConnectionMetaData implements ConnectionMetaData { int major = 0; int minor = 0; try { - Package p = Package.getPackage("org.apache.qpid.jms"); + Package p = Package.getPackage(JmsConnectionMetaData.class.getPackage().getName()); if (p != null) { version = p.getImplementationVersion(); Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+).*"); @@ -56,7 +56,8 @@ public final class JmsConnectionMetaData implements ConnectionMetaData { } } catch (Throwable e) { InputStream in = null; - if ((in = JmsConnectionMetaData.class.getResourceAsStream("/org/apache/qpid/jms/version.txt")) != null) { + String path = JmsConnectionMetaData.class.getPackage().getName().replace(".", "/"); + if ((in = JmsConnectionMetaData.class.getResourceAsStream("/" + path + "/version.txt")) != null) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(in, Charset.forName("US-ASCII"))); version = reader.readLine(); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org