@@ -62,11 +62,11 @@ public CassandraClientURI(String uri, Properties info) {
6262 }
6363 }
6464
65- this .userName = getOption (info , options , "user" );
66- this .password = getOption (info , options , "password" );
67- String sslEnabledOption = getOption (info , options , "sslenabled" );
65+ this .userName = getOption (info , options , "user" , null );
66+ this .password = getOption (info , options , "password" , null );
67+ String sslEnabledOption = getOption (info , options , ENABLE_SSL , ENABLE_SSL_DEFAULT );
6868 this .sslEnabled = isTrue (sslEnabledOption );
69- String verifyServerCertOption = getOption (info , options , VERIFY_SERVER_CERTIFICATE );
69+ String verifyServerCertOption = getOption (info , options , VERIFY_SERVER_CERTIFICATE , VERIFY_SERVER_CERTIFICATE_DEFAULT );
7070 this .verifyServerCert = isTrue (verifyServerCertOption );
7171
7272
@@ -97,14 +97,15 @@ public CassandraClientURI(String uri, Properties info) {
9797 * @return option from properties or from uri if it is not found in properties.
9898 * null if options was not found.
9999 */
100- private String getOption (Properties properties , Map <String , List <String >> options , String optionName ) {
100+ private String getOption (Properties properties , Map <String , List <String >> options , String optionName , String defaultValue ) {
101101 if (properties != null ) {
102102 String option = (String ) properties .get (optionName );
103103 if (option != null ) {
104104 return option ;
105105 }
106106 }
107- return getLastValue (options , optionName );
107+ String value = getLastValue (options , optionName );
108+ return value != null ? value : defaultValue ;
108109 }
109110
110111 Cluster createCluster () throws java .net .UnknownHostException , SSLParamsException {
0 commit comments