Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-19 Thread Erik Gahlin
Mandy Chung skrev 2013-08-15 19:31: On 8/15/2013 5:35 AM, Erik Gahlin wrote: Mandy Chung skrev 2013-08-12 20:49: Should L358, 359, 388 need to be guarded to validate the result value? paintBorder and fillRect accepts negative and zero values so there will not be an exception. What happe

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-19 Thread Mandy Chung
On 8/19/2013 11:55 AM, Erik Gahlin wrote: Hi Mandy, Fixing calculateTickInterval is not needed if Leifs suggestion is used. Here is an updated webrev with reused variable names and a fixed copyright header. http://cr.openjdk.java.net/~egahlin/6358357_3/ Could you please have a look? Look

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-16 Thread Erik Gahlin
Thanks for the input The graph will now disappear when the area for the plot becomes too small, which is probably the best way to handle a small window size. Here is an updated review with Leif suggestion http://cr.openjdk.java.net/~egahlin/6358357_2/ Erik Leif Samuelsson skrev 2013-08-15 2

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-15 Thread Leif Samuelsson
Hi, It's been so long since I worked on either Swing or JConsole that I barely recognize the code anymore. :) I think the best practice here would be move the test w <= 0 || h <= 0 to to the top of the paintComponent() method. There is a potential big problem with having the return in the middle

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-15 Thread Mandy Chung
On 8/15/2013 5:35 AM, Erik Gahlin wrote: Mandy Chung skrev 2013-08-12 20:49: Should L358, 359, 388 need to be guarded to validate the result value? paintBorder and fillRect accepts negative and zero values so there will not be an exception. What happens if the variable h evaluated at L35

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-15 Thread Erik Gahlin
Jaroslav Bachorik skrev 2013-07-29 23:58: Hi Erik, I wonder whether it wouldn't be better to default the "w" to sufficiently small non-null number (eg. 1) than just abandon the whole process. It feels more risky, the user will not be able to see anything anyway. We might as well abandon. Als

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-15 Thread Erik Gahlin
Mandy Chung skrev 2013-08-12 20:49: Should L358, 359, 388 need to be guarded to validate the result value? paintBorder and fillRect accepts negative and zero values so there will not be an exception. Erik Mandy On 7/29/2013 1:02 PM, Erik Grahlin wrote: Please review a small change: Desc

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-08-12 Thread Mandy Chung
Should L358, 359, 388 need to be guarded to validate the result value? Mandy On 7/29/2013 1:02 PM, Erik Grahlin wrote: Please review a small change: Description: Switch to the Threads tab and try shrinking the window. When the window width becomes smaller than some particular size, an exceptio

Re: RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-07-29 Thread Jaroslav Bachorik
Hi Erik, I wonder whether it wouldn't be better to default the "w" to sufficiently small non-null number (eg. 1) than just abandon the whole process. Also, the copyright year should be updated. I can be the sponsor. -JB- On 07/29/2013 01:02 PM, Erik Gahlin wrote: > Please review a small change

RFR (XS): 6358357: Division by zero in Threads tab when shrinking jconsole window

2013-07-29 Thread Erik Gahlin
Please review a small change: Description: Switch to the Threads tab and try shrinking the window. When the window width becomes smaller than some particular size, an exception is printed to the terminal on every window update. Bug: http://monaco.us.oracle.com/detail.jsf?cr=6358357 Webrev: h