cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [1/3] git commit: fix npe if configURL is null (new URL(null) throws)
Date Sat, 03 May 2014 20:42:58 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 2b674656e -> 848494d5f


fix npe if configURL is null (new URL(null) throws)


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3fb2dcdf
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3fb2dcdf
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3fb2dcdf

Branch: refs/heads/trunk
Commit: 3fb2dcdf06fa74db14891abb76a447c040f32436
Parents: 3047ab6
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Sat May 3 16:39:16 2014 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Sat May 3 16:39:16 2014 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/locator/SnitchProperties.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3fb2dcdf/src/java/org/apache/cassandra/locator/SnitchProperties.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/SnitchProperties.java b/src/java/org/apache/cassandra/locator/SnitchProperties.java
index 52268da..36fec7f 100644
--- a/src/java/org/apache/cassandra/locator/SnitchProperties.java
+++ b/src/java/org/apache/cassandra/locator/SnitchProperties.java
@@ -38,9 +38,12 @@ public class SnitchProperties
         String configURL = System.getProperty(RACKDC_PROPERTY_FILENAME);
         try
         {
-            URL url = new URL(configURL);
+            URL url;
             if (configURL == null)
                 url = SnitchProperties.class.getClassLoader().getResource(RACKDC_PROPERTY_FILENAME);
+            else 
+            	url = new URL(configURL);
+            
             stream = url.openStream(); // catch block handles potential NPE
             properties.load(stream);
         }


Mime
View raw message