Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3662

Remove NPE Possibility in Follower Class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.7.0
    • None

    Description

      Follower.java
          public long getZxid() {
              try {
                  synchronized (fzk) {
                      return fzk.getZxid();
                  }
              } catch (NullPointerException e) {
                  LOG.warn("error getting zxid", e);
              }
              return -1;
          }
      

      I traced the code and there is no reason to catch a NPE here. Add additional restrictions to make sure NPE will never happen.

      Attachments

        Issue Links

          Activity

            People

              belugabehr David Mollitor
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3.5h
                  3.5h