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

Bytes#toShort doesn't work without unsafe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 1.5.0, 2.2.0, 2.1.1, 2.0.3
    • None
    • None
    • 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.v0.patch
          4 kB
          Chia-Ping Tsai
        2. HBASE-21208.v1.patch
          4 kB
          Chia-Ping Tsai
        3. HBASE-21208.v2.patch
          5 kB
          Chia-Ping Tsai

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: