Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-11030

HBaseTestingUtility.getMiniHBaseCluster should be able to return null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.99.0, 0.94.19, 0.98.2, 0.96.3
    • None
    • None
    • Reviewed

    Description

      Right now we have this logic:

        public MiniHBaseCluster getMiniHBaseCluster() {
          if (this.hbaseCluster instanceof MiniHBaseCluster) {
            return (MiniHBaseCluster)this.hbaseCluster;
          }
          throw new RuntimeException(hbaseCluster + " not an instance of " +
                                     MiniHBaseCluster.class.getName());
        }
      

      Since null is not actually an instance of MiniHBaseCluster we'll throw the RuntimeException rather than returning null.
      Some tests call this method and check for null, which is pointless.

      Attachments

        1. 11030-trunk.txt
          0.7 kB
          Lars Hofhansl

        Activity

          People

            larsh Lars Hofhansl
            larsh Lars Hofhansl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: