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

Bytes#toShort doesn't work without unsafe

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0, 2.2.0, 2.1.1, 2.0.3
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      seems we put the brackets in the wrong place.

            short n = 0;
            n = (short) ((n ^ bytes[offset]) & 0xFF);
            n = (short) (n << 8);
            n = (short) ((n ^ bytes[offset+1]) & 0xFF);   // this one
            return n;
      

        Attachments

        1. HBASE-21208.v2.patch
          5 kB
          Chia-Ping Tsai
        2. HBASE-21208.v1.patch
          4 kB
          Chia-Ping Tsai
        3. HBASE-21208.v0.patch
          4 kB
          Chia-Ping Tsai

          Issue Links

            Activity

              People

              • Assignee:
                chia7712 Chia-Ping Tsai
                Reporter:
                chia7712 Chia-Ping Tsai
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: