[ 
https://issues.apache.org/jira/browse/GORA-499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jaechang Nam updated GORA-499:
------------------------------
    Description: 
Dear Gora developers

In recent got repositiry, I've found the following lines in 
gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java.

It seems readOpConsLvl or writeOpConsLvl is null, there could be 
NullPointerException as the comparison operator is "||" rather using "&&". I 
have no idea if this is an actual bug but just reporting. Thanks!

<code>
String opConsisLvl = (readOpConsLvl!=null || 
!readOpConsLvl.isEmpty())?readOpConsLvl:DEFAULT_HECTOR_CONSIS_LEVEL;
      
ccl.setDefaultReadConsistencyLevel(HConsistencyLevel.valueOf(opConsisLvl));
      LOG.debug("Hector read consistency configured to '" + opConsisLvl + "'.");
      opConsisLvl = (writeOpConsLvl!=null || 
!writeOpConsLvl.isEmpty())?writeOpConsLvl:DEFAULT_HECTOR_CONSIS_LEVEL;
</code>

  was:
Dear Gora developers

In recent got repositiry, I've found the following lines in 
gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java.

It seems readOpConsLvl or writeOpConsLvl is null, there could be 
NullPointerException as the comparison operator is "||" rather using "&&". I 
have no idea if this is an actual bug but just reporting. Thanks!

<pre>
String opConsisLvl = (readOpConsLvl!=null || 
!readOpConsLvl.isEmpty())?readOpConsLvl:DEFAULT_HECTOR_CONSIS_LEVEL;
      
ccl.setDefaultReadConsistencyLevel(HConsistencyLevel.valueOf(opConsisLvl));
      LOG.debug("Hector read consistency configured to '" + opConsisLvl + "'.");
      opConsisLvl = (writeOpConsLvl!=null || 
!writeOpConsLvl.isEmpty())?writeOpConsLvl:DEFAULT_HECTOR_CONSIS_LEVEL;
</pre>


> Potential NPE issue
> -------------------
>
>                 Key: GORA-499
>                 URL: https://issues.apache.org/jira/browse/GORA-499
>             Project: Apache Gora
>          Issue Type: Bug
>            Reporter: Jaechang Nam
>            Priority: Minor
>
> Dear Gora developers
> In recent got repositiry, I've found the following lines in 
> gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java.
> It seems readOpConsLvl or writeOpConsLvl is null, there could be 
> NullPointerException as the comparison operator is "||" rather using "&&". I 
> have no idea if this is an actual bug but just reporting. Thanks!
> <code>
> String opConsisLvl = (readOpConsLvl!=null || 
> !readOpConsLvl.isEmpty())?readOpConsLvl:DEFAULT_HECTOR_CONSIS_LEVEL;
>       
> ccl.setDefaultReadConsistencyLevel(HConsistencyLevel.valueOf(opConsisLvl));
>       LOG.debug("Hector read consistency configured to '" + opConsisLvl + 
> "'.");
>       opConsisLvl = (writeOpConsLvl!=null || 
> !writeOpConsLvl.isEmpty())?writeOpConsLvl:DEFAULT_HECTOR_CONSIS_LEVEL;
> </code>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to