<Swing Dev> [9] Review Request: 4339584 Adding a getUI public method to JComponent
Alexander Scherbatiy
alexandr.scherbatiy at oracle.com
Fri Aug 21 10:10:11 UTC 2015
On 8/21/2015 1:04 PM, Sergey Bylokhov wrote:
> Hello.
> Please review a small fix for jdk9.
>
> Long long time ago the next request was filed for jdk 1.4.0:
> "Today, there is no way for a program to access the UI of a
> JComponent. Adding a getUI method would provide that capability and be
> consistent with the fact that, for example, the JComponent's Border is
> accessible"
>
> It was evaluated and was closed:
> "JComponent does not have a getUI so that each class can override it
> to return the UI that is appropriate for the class, such as TreeUI or
> TextUI..."
>
> The problem was in absent of covariant returns, which were added to
> the jdk 1.5. So now we can add the "ComponentUI getUI()" method to the
> JComponent and in the same time we will have an ability to override it
> using more specific return value in subclasses.
Could it break a binary compatibility if someone does not follow the
javadoc specification and has in his program getUI() method which return
type is not subclass of the ComponentUI?
Thanks,
Alexandr.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-4339584
> Webrev can be found at:
> http://cr.openjdk.java.net/~serb/4339584/webrev.00
>
More information about the swing-dev
mailing list