cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1143192 - /cassandra/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java
Date Tue, 05 Jul 2011 20:21:36 GMT
Author: jbellis
Date: Tue Jul  5 20:21:36 2011
New Revision: 1143192

URL: http://svn.apache.org/viewvc?rev=1143192&view=rev
Log:
formatting

Modified:
    cassandra/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java

Modified: cassandra/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java
URL: http://svn.apache.org/viewvc/cassandra/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java?rev=1143192&r1=1143191&r2=1143192&view=diff
==============================================================================
--- cassandra/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java (original)
+++ cassandra/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java Tue
Jul  5 20:21:36 2011
@@ -80,22 +80,24 @@ class CassandraConnection extends Abstra
         {
             String rawUri = url.substring(PROTOCOL.length());
             URI uri = new URI(rawUri);
-            
-            String host = uri.getHost()==null ? "localhost" : uri.getHost() ;
-            int port = (uri.getPort() ==-1) ? 9160 : uri.getPort();
-            String keyspace = (uri.getPath().length()==0) ? null : uri.getPath().substring(1);
+
+            String host = uri.getHost() == null ? "localhost" : uri.getHost();
+            int port = (uri.getPort() == -1) ? 9160 : uri.getPort();
+            String keyspace = (uri.getPath().length() == 0) ? null : uri.getPath().substring(1);
             String userInfo = uri.getUserInfo();
-            String[] s = new String[0]; 
+            String[] s = new String[0];
 
-            if ((userInfo!=null) && (!userInfo.isEmpty())) s = userInfo.split(";");
+            if ((userInfo != null) && (!userInfo.isEmpty()))
+                s = userInfo.split(";");
 
             // use user and password from the properties file( which takes precedence over
url values)
-            String username = props.getProperty("user", (s.length>0) ? s[0] : null);
-            String password = props.getProperty("password", (s.length>1) ? s[1] : null);
-            
-            cassandraCon = new org.apache.cassandra.cql.jdbc.Connection(host, port, username,password);
+            String username = props.getProperty("user", (s.length > 0) ? s[0] : null);
+            String password = props.getProperty("password", (s.length > 1) ? s[1] : null);
+
+            cassandraCon = new org.apache.cassandra.cql.jdbc.Connection(host, port, username,
password);
             final String useQ = "USE " + keyspace;
-            if (keyspace!=null) cassandraCon.execute(useQ);
+            if (keyspace != null)
+                cassandraCon.execute(useQ);
         }
         catch (SchemaDisagreementException e)
         {



Mime
View raw message