DevCharly commented on PR #4619:
URL: https://github.com/apache/netbeans/pull/4619#issuecomment-1243989391

   Usage of `<subpackages>` seems to change sigtest behavior:
   
   When I run Ant target `gen-sigtest` without `<subpackages>` (commit 
d739624220de5813b921f55916372f5f62573975), then `org-netbeans-libs-flatlaf.sig` 
**grows** from 62k to **380k** (because of added packages) and gen-sigtest 
reports following error:
   ~~~
   RETURN TYPE FOR FlatFileChooserUI::createDirectoryComboBoxRenderer
       CHANGED FROM 
javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxRenderer
       TO javax.swing.DefaultListCellRenderer
   ~~~
   
   But when using `<subpackages>` (commit 
3c14ba953043549a871ee5054cb54f377e7f9cae), `org-netbeans-libs-flatlaf.sig` 
**shrinks** from 62k to **24k** and gen-sigtest does not report any error. 
`org-netbeans-libs-flatlaf.sig` **does not** contain any class from the 
subpackages.
   
   When using following, `org-netbeans-libs-flatlaf.sig` stays unchanged.
   ~~~xml
   <subpackages>com.formdev.flatlaf</subpackages>
   <package>com.formdev.flatlaf.util</package>
   ~~~
   
   I wonder what the consequences are for module versioning and API checks...
   Does this mean that only package `com.formdev.flatlaf` is checked for API 
changes?
   And API changes in subpackages are ok?
   
   
   ### Regarding FlatLaf API compatibility
   
   Only classes in packages `com.formdev.flatlaf` and 
`com.formdev.flatlaf.util` are kept API compatible.
   There is a sigtest task in 
[flatlaf-core/build.gradle.kts](https://github.com/JFormDesigner/FlatLaf/blob/main/flatlaf-core/build.gradle.kts)
 that automatically checks it.
   Due to future development, classes in all other package are internal and may 
(and do) change (without notice).
   
   ### NetBeans module versioning
   
   To my understanding, when doing incompatible API changes, the modules "Major 
release version" must be increased, which makes all modules, that depend on it, 
incompatible. IMHO this should be prevented in any case because this causes 
problems with 3rd party plugins.
   
   E.g. [JFormDesigner v8](https://www.formdev.com/jformdesigner/) depends on 
module `org.netbeans.libs.flatlaf/1`. If NB 16 would use a newer FlatLaf 
version with changes in subpackages, it needs to change major version to 
`org.netbeans.libs.flatlaf/2`, which makes JFormDesigner v8 incompatible with 
NB16. Sure, can update JFormDesigner to depend on 
`org.netbeans.libs.flatlaf/2`, but then it no longer works with previous NB 
versions. So it would be necessary to build and distribute two JFormDesigner 
builds: one for NB 16 and another one for NB 15 and older. This would be a 
nightmare for me and for JFormDesigner users...
   
   ### Conclusion
   
   If this PR means that all classes in all FlatLaf subpackages are handled as 
"module API" and can not changed any more, then I'm against this PR. Then it is 
better to make changes to `flatlaf-swingx.jar` to avoid usage of non-public 
packages. (I'll check this)
   
   If sigtest behavior regarding `<subpackages>` is normal and expected (not a 
bug), then I'm fine with this PR.
   But please also add `<package>com.formdev.flatlaf.util</package>` to 
`project.xml` to keep  `org-netbeans-libs-flatlaf.sig` unchanged.
   
   Anyway IMO it is strange that `<subpackages>` makes all subpackages public 
but sigtest ignores them... 😕 


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to