Copilot commented on code in PR #2455:
URL: https://github.com/apache/groovy/pull/2455#discussion_r3063687918
##########
subprojects/groovy-swing/src/main/groovy/groovy/swing/LookAndFeelHelper.groovy:
##########
@@ -156,7 +156,8 @@ class LookAndFeelHelper {
for (klass in [
'com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel',
'sun.swing.plaf.nimbus.NimbusLookAndFeel',
- 'org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel'
+ 'org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel',
+ 'javax.swing.plaf.nimbus.NimbusLookAndFeel'
Review Comment:
This change affects which class name the built-in `nimbus` alias resolves
to, but there doesn’t appear to be any test coverage asserting that
`SwingBuilder.lookAndFeel('nimbus')` works (or that `getNimbusLAFName()`
resolves correctly when Nimbus is available). Consider adding a small,
environment-tolerant test (e.g., only asserting when the class is present) to
prevent regressions.
##########
subprojects/groovy-swing/src/main/groovy/groovy/swing/LookAndFeelHelper.groovy:
##########
@@ -156,7 +156,8 @@ class LookAndFeelHelper {
for (klass in [
'com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel',
'sun.swing.plaf.nimbus.NimbusLookAndFeel',
- 'org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel'
+ 'org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel',
+ 'javax.swing.plaf.nimbus.NimbusLookAndFeel'
Review Comment:
Now that the standard Nimbus LAF class
(`javax.swing.plaf.nimbus.NimbusLookAndFeel`) is included, it should be
preferred before the legacy/internal `com.sun.*`/`sun.*` variants. As written,
the helper will still return `com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel`
whenever it is present, which can cause avoidable JPMS encapsulation/access
issues and ties the alias to non-standard packages even when the public API is
available.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]