Hive
  1. Hive
  2. HIVE-7452

Boolean comparison is done through reference equality rather than using equals

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.14.0
    • Component/s: None
    • Labels:
      None

      Description

      In Driver#doAuthorization():

              if (tbl != null && !tableAuthChecked.contains(tbl.getTableName()) &&
                  !(tableUsePartLevelAuth.get(tbl.getTableName()) == Boolean.TRUE)) {
      

      The above comparison should be done using .equals() method.
      The comparison below doesn't evaluate to true:

          Boolean b = new Boolean(true);
          if (b == Boolean.TRUE) {
      

        Activity

        Ted Yu created issue -
        KangHS made changes -
        Field Original Value New Value
        Attachment HIVE-7452.patch [ 12660356 ]
        KangHS made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Ashutosh Chauhan made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Assignee KangHS [ hs ]
        Fix Version/s 0.14.0 [ 12326450 ]
        Resolution Fixed [ 1 ]
        Thejas M Nair made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            KangHS
            Reporter:
            Ted Yu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development