<Swing Dev> JDK-8190348: [TESTBUG] Test javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java fails

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Sat Nov 18 00:22:29 UTC 2017


+1

On 16/11/2017 21:52, Prasanta Sadhukhan wrote:
> +1
> 
> Regards
> Prasanta
> On 11/16/2017 4:28 PM, Pankaj Bansal wrote:
>>
>> Hi All,
>>
>> Please review the fix for JDK 10.
>>
>> Bug:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8190348
>>
>> Webrev:
>>
>> http://cr.openjdk.java.net/~pbansal/8190348/webrev.00/ 
>> <http://cr.openjdk.java.net/%7Epbansal/8190348/webrev.00/>
>>
>> Issue:
>>
>> The test fails with or without HiDPI with Exception.
>>
>> Failed. Execution failed: `main' threw exception: 
>> java.lang.RuntimeException: bounds = 
>> java.awt.Rectangle[x=74,y=40,width=181,height=185] loc = 
>> java.awt.Point[x=274,y=240] background loc = 100, 100 so middle point 
>> over background is 264, 232 Oval is not opaque in the middle point 
>> (364, 332, java.awt.Color[r=51,g=51,b=51])
>>
>> Fix:
>>
>> The test case creates a class PerPixelTranslucentCanvas which drives 
>> from Common class. It has a instance variable OVAL_COLOR. In the 
>> constructor, it is calling super class constructor which in turn calls 
>> createSwingComponents function which is overridden by 
>> PerPixelTranslucentCanvas. This function uses the OVAL_COLOR. The 
>> instance variables are loaded before the class construction, but after 
>> the super constructor has been called. As the variable is not static, 
>> it is not yet loaded and null is used. So this variable should be 
>> static, so that it is created on class loading.
>>
>> There are variables BG_COLOR and FG_COLOR in common class which are 
>> static as well.
>>
>> Also added an addition @run to run the test at HiDPI also like other 
>> tests in the same folder.
>>
>> Regards,
>>
>> Pankaj Bansal
>>
> 


-- 
Best regards, Sergey.



More information about the swing-dev mailing list