<Swing Dev> [15] RFR JDK-8222759: com.sun.java.swing.plaf.gtk.GTKLookAndFeel Unneccessary casts to GTKStyleFactory

Jayathirth D v JAYATHIRTH.D.V at ORACLE.COM
Mon Dec 23 07:27:30 UTC 2019


Changes are fine.

Thanks,
Jay

> On 23-Dec-2019, at 12:46 PM, Pankaj Bansal <pankaj.b.bansal at oracle.com> wrote:
> 
> Hi Jay,
>  
> I have done the changes you suggested.
> webrev: http://cr.openjdk.java.net/~pbansal/8222759/webrev01/ <http://cr.openjdk.java.net/~pbansal/8222759/webrev01/>
>  
> Regards,
> Pankaj
>   <>
> From: Jayathirth D v 
> Sent: Monday, December 23, 2019 12:08 PM
> To: Pankaj Bansal
> Cc: swing-dev at openjdk.java.net
> Subject: Re: <Swing Dev> [15] RFR JDK-8222759: com.sun.java.swing.plaf.gtk.GTKLookAndFeel Unneccessary casts to GTKStyleFactory
>  
> Its better if we can make this test run only in Linux as GTK is specific to it.
> Other changes are fine.
>  
> Thanks,
> Jay
> 
> 
> On 20-Dec-2019, at 10:31 PM, Phil Race <philip.race at oracle.com <mailto:philip.race at oracle.com>> wrote:
>  
> Looks fine. Please use the amended and corrected  bug synopsis in the commit message
> 
> -phil.
> 
> On 12/19/19 11:36 PM, Pankaj Bansal wrote:
> Hi All,
> Please review the following fix for jdk15.
> 
> Bug: 
> https://bugs.openjdk.java.net/browse/JDK-8222759 <https://bugs.openjdk.java.net/browse/JDK-8222759>
>  
> webrev:
> http://cr.openjdk.java.net/~pbansal/8222759/webrev00/ <http://cr.openjdk.java.net/~pbansal/8222759/webrev00/>
>  
> Issue:
> There are some unnecessary casts of javax.swing.plaf.synth.SynthStyleFactory to com.sun.java.swing.plaf.gtk.GTKStyleFactory in GTKLookAndFeel class. There is only one function “getStyle” being called after this cast, but that is declared in SynthStyleFactory as abstract and defined in GTKStyleFactory. So this function can be called without this cast too.
> Because of this cast, if someone is trying to use a custom SynthStyleFactory with GTKLookAndFeel, there is a ClassCastException.
>  
> Fix:
> Removed the cast as it is not required here. 
>  
> Testing:
> I have run SwingSet2 with GTKLookAndFeel after this change. All works fine. Added testcase fails without fix and passes after the fix.
> 
> Regards,
> Pankaj Bansal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20191223/5bba9042/attachment-0001.htm>


More information about the swing-dev mailing list