<Swing Dev> Fix for JDK-8065861 : Pressing Esc does not set 'canceled' property of ProgressMonitor

Alexandr Scherbatiy alexandr.scherbatiy at oracle.com
Thu Jun 9 15:25:55 UTC 2016


On 6/8/2016 5:35 PM, Ajit Ghaisas wrote:
> Hi,
>
> Bug :
> https://bugs.openjdk.java.net/browse/JDK-8065861
>
> Issue :
> Pressing Esc does not set 'canceled' property of ProgressMonitor
>
> Analysis :
> ProgressMonitor option pane only gets hidden on pressing Escape key.
> It is not truly canceled as isCanceled() method continues to return false.
>
> Fix :
> On Pressing Escape key JOptionPane.CLOSED_OPTION value is set in JOptionPane from BasicOptionPaneUI.java.
> This value is used as a condition in isCanceled() to identify ProgressMonitor is canceled by pressing Escape key.
>
> Please review the webrev:
> http://cr.openjdk.java.net/~aghaisas/8065861/webrev.00/
      The updated code calls methods from 'v' object before it is 
checked to the null which can lead to the NPE. The cancelOption[0] also 
can throw the IOBE before the arrays length checking.

   Thanks,
   Alexandr.
> On review completion, I will raise a CCC request for documentation change.
>
> Regards,
> Ajit




More information about the swing-dev mailing list