Uploaded image for project: 'Apache Gora'
  1. Apache Gora
  2. GORA-499

Potential NPE issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.7
    • gora-cassandra
    • None

    Description

      Dear Gora developers

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

      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;
      

      It seems, if 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!

      Attachments

        Issue Links

          Activity

            People

              lifove JC
              lifove JC
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: