Uploaded image for project: 'Tajo (Retired)'
  1. Tajo (Retired)
  2. TAJO-414

Fix bug of bit operations in decode() method of DateDatum class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      data structure for date is 32 bits and consists of

      meaning Year Month Day
      bit offset 31-16 15-8 7 - 0

      However, current code does not correctly decode the structure as

        private static LocalDate decode(int val) {
          int year = (val >> 16);
          int monthOfYear = (0x0FFF & val) >> 8;
          int dayOfMonth = (0xF0FF & val);
          return new LocalDate(year, monthOfYear, dayOfMonth);
        }
      

      Bit operations should be changed to

          int monthOfYear = (0xFFFF & val) >> 8;
          int dayOfMonth = (0x00FF & val);
      

      Attachments

        1. TAJO-414.patch
          0.6 kB
          Keuntae Park

        Activity

          People

            sirpkt Keuntae Park
            sirpkt Keuntae Park
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: