<Swing Dev> [9] Review Request: 4339584 Adding a getUI public method to JComponent

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Fri Aug 21 11:41:38 UTC 2015


   The fix looks good to me.

   Thanks,
   Alexandr.

On 8/21/2015 2:37 PM, Sergey Bylokhov wrote:
> On 21.08.15 14:20, Alexander Scherbatiy wrote:
>> On 8/21/2015 1:49 PM, Sergey Bylokhov wrote:
>>> I just double checked that if I compiles the subclass when the 
>>> parent class has not this method, then recompiles a new parent, the 
>>> correct method in subclass still called, so it seems fine. Probably 
>>> there are some other cases, which will be checked during ccc review.
>>
> Yes this case will be broken, since this getter contradicts the 
> specification described in JComponent.setUI.
>
>>     I mean the following case:
>>     -------------------------------
>>     public class CustomComponent extends JComponent {
>>
>>         class CustomComponentUI {}
>>
>>         CustomComponentUI getUI() {
>>             return null;
>>         }
>>     }
>>     -------------------------------
>>
>>   Thanks,
>>   Alexandr.
>>
>>>
>>>
>>>> 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