Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8277909

potential integer overflow in javax.swing.SizeSequence

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      the class is a helper for variable row-height in JTable. To perform some search, it computes the mid of some intervall using the expression
              int mid = (from + to) / 2; // there are 6 occurences of this in the class
      this is prone to intermeditate integer-overflow (the classical error in binary search).
      the expression should be written as
             int mid = (from + to ) >>> 1;
      as in other places in the JDK.


      CUSTOMER SUBMITTED WORKAROUND :
      keep the JTables small enough

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: