RFR: 8378389: Remove AppContext from the Swing RepaintManager

Phil Race prr at openjdk.org
Mon Feb 23 23:10:17 UTC 2026


On Mon, 23 Feb 2026 22:38:55 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Remove AppContext from RepaintManager
>> 
>> Please review the CSR too.
>
> src/java.desktop/share/classes/javax/swing/RepaintManager.java line 245:
> 
>> 243:      *          be used by an overridden version to return a different RepaintManager
>> 244:      *          depending on the Component
>> 245:      * @return the RepaintManager object
> 
> This spec looks broken as well, how this method could be "overridden"?

I don't think it can mean the method is overridden.
Probably  it means a hypothetical implementation of RepaintManager could return a per-component instance. 
Not sure I want to try to reword that as part of this change.

But I notice this also mentions "thread". I will fix that.

> src/java.desktop/share/classes/javax/swing/RepaintManager.java line 259:
> 
>> 257:      * Returns the RepaintManager.
>> 258:      */
>> 259:     static RepaintManager currentManager() {
> 
> I think we should inline this method into currentManager(Component c) above and update all usages of currentManager(AppContext) to use the component instead.

I think that's just the cases seen in this PR already - 4 of them.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29862#discussion_r2843498103
PR Review Comment: https://git.openjdk.org/jdk/pull/29862#discussion_r2843531401


More information about the client-libs-dev mailing list