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

TestRSGroupsBase has some always false checks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 1.4.0, 2.0.0
    • rsgroup, test
    • None
    • Reviewed

    Description

      Discovered via error-prone analysis:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project hbase-rsgroup: Compilation failure: Compilation failure:
      [ERROR] /Users/mdrob/IdeaProjects/hbase/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java:[421,40] [CollectionIncompatibleType] Argument 'region' should not be passed to this method; its type RegionInfo is not compatible with its collection's type argument String
      [ERROR]     (see http://errorprone.info/bugpattern/CollectionIncompatibleType)
      [ERROR] /Users/mdrob/IdeaProjects/hbase/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java:[531,65] [CollectionIncompatibleType] Argument 'targetRegion' should not be passed to this method; its type String is not compatible with its collection's type argument RegionInfo
      [ERROR]     (see http://errorprone.info/bugpattern/CollectionIncompatibleType)
      

      Both of these are checks to List<T>.contains with an element of the wrong type so they will always return false. The first is an optimization that we can probably live without (or short circuit on the Master, at least) the second is an assertion that will never fail, rendering the test ineffective.

      Attachments

        1. HBASE-19194.patch
          2 kB
          Andrew Kyle Purtell
        2. HBASE-19194-branch-1.patch
          3 kB
          Andrew Kyle Purtell

        Issue Links

          Activity

            People

              apurtell Andrew Kyle Purtell
              mdrob Mike Drob
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: