Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-6470

Wrong casting of long value to int leads to incorrect results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.3
    • None
    • None

    Description

      Wrong casting of long value to int leads to incorrect results:

          /** {@inheritDoc} */
          @Override public int pages() {
              if (!inited)
                  return 0;
              
              // allocated.get() returns long value. We should cast it to int after division.
              return (int)((allocated.get() - headerSize()) / pageSize);
          }
      
      

      Attachments

        Activity

          People

            agura Andrey N. Gura
            agura Andrey N. Gura
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: