On Tue, 15 Sep 2026 07:35:29 GMT, Matthias Baesken <[email protected]> wrote:

>> src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java line 79:
>> 
>>> 77:         putClientProperty("JToolBar.isRollover", Boolean.TRUE);
>>> 78: 
>>> 79:         boolean isXPPlatform = (OSInfo.getOSType() == 
>>> OSInfo.OSType.WINDOWS);
>> 
>> I wonder whether `isXPPlatform` is needed at all, seemingly 
>> `WindowsPlacesBar` is a Windows-specific class.
>> 
>> We may remove `isXPPlatform` and hard-code the height, `buttonSize = new 
>> Dimension(83, isXPPlatform ? 65 : 54)`, as if `isXPPlatform` is always 
>> `true`. The class is used in `WindowsFileChooserUI` only, it should never be 
>> instantiated on other platforms but Windows.
>
>> > I wonder whether isXPPlatform is needed at all, seemingly WindowsPlacesBar 
>> > is a Windows-specific class.
> 
> Yes WindowsPlacesBar  is only used on Windows 
> 
> https://github.com/search?q=repo%3Aopenjdk%2Fjdk+WindowsPlacesBar&type=code
> 
> Should we maybe move it to jdk/src/java.desktop/windows  ?
> But I would prefer doing it in a follow up change.

I don't think we can move the class to a different package now. Even though 
apps shouldn't have used it, there are chances that there are apps or L&Fs 
which did, and moving the class would break those apps.

The comment above the class declaration suggests the class was accessed from 
two different packages.

https://github.com/openjdk/jdk/blob/a71f4dc2a77bb7837fb9ff2779f14afc7042153f/src/java.desktop/share/classes/sun/swing/WindowsPlacesBar.java#L58-L60

Yet I can't find any usages except for `WindowsFileChooserUI`.

`WindowsPlacesBar` should've been in the `com.sun.java.swing.plaf.windows` 
package along with `WindowsFileChooserUI`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32419#discussion_r4047657894

Reply via email to