<Swing Dev> RFR: 8262085: Hovering Metal HTML Tooltips in different windows cause IllegalArgExc on Linux [v2]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Mon Mar 1 04:11:39 UTC 2021


On Sun, 28 Feb 2021 07:39:20 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

>> This issue occurs only under `MetalLookAndFeel` on Linux. 
>> 
>> It was introduced by [JDK-8040630](https://bugs.openjdk.java.net/browse/JDK-8040630) fix.
>> 
>>> component.setBounds(ownerX, ownerY, 1, 1);
>> 
>> This line adds an extra reshape call with `1x1` size right before getting another one with correct sizes.
>> 
>> If `MetalToolTipUI#paint()` call happens before getting correct sizes,  it calculates `paintTextR` with negative sizes for component with `1x1` size,  thus IAE is thrown.
>> 
>> The fix is to do not proceed with `paint()` for negative sizes.
>> The provided test fails for me in 0-30s interval(before the fix), other testing(client-tier1,2,3) looks good.
>
> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   simplified test

test/jdk/javax/swing/JToolTip/FastTooltipSwitchIAE.java line 61:

> 59:         } catch (ClassNotFoundException | InstantiationException |
> 60:                 UnsupportedLookAndFeelException | IllegalAccessException e) {
> 61:             throw new RuntimeException(e);

Normally for UnsupportedLookAndFeelException, we dont throw Exception, rather print and continue to next L&F.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2761


More information about the swing-dev mailing list