activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [3/3] git commit: remove npe when no jars on classpath, in ide
Date Tue, 07 Oct 2014 14:03:49 GMT
remove npe when no jars on classpath, in ide


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

Branch: refs/heads/trunk
Commit: 57fc29b6ce5b80930021733c313862b817e6b537
Parents: 838bbeb
Author: gtully <gary.tully@gmail.com>
Authored: Tue Oct 7 14:07:49 2014 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Oct 7 14:50:41 2014 +0100

----------------------------------------------------------------------
 .../org/apache/activemq/ActiveMQConnectionMetaData.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/57fc29b6/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
index b6d6c87..74b1039 100755
--- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
+++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnectionMetaData.java
@@ -43,11 +43,13 @@ public final class ActiveMQConnectionMetaData implements ConnectionMetaData
{
             Package p = Package.getPackage("org.apache.activemq");
             if (p != null) {
                 version = p.getImplementationVersion();
-                Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+).*");
-                Matcher m = pattern.matcher(version);
-                if (m.matches()) {
-                    major = Integer.parseInt(m.group(1));
-                    minor = Integer.parseInt(m.group(2));
+                if (version != null) {
+                    Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+).*");
+                    Matcher m = pattern.matcher(version);
+                    if (m.matches()) {
+                        major = Integer.parseInt(m.group(1));
+                        minor = Integer.parseInt(m.group(2));
+                    }
                 }
             }
         } catch (Throwable e) {


Mime
View raw message