netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Upgrade Commons-IO from 2.6.0 to 2.11.0

Open pepness opened this issue 3 years ago • 4 comments

Library Notes:

  • Require Java 8
  • 63 Bug fixes
  • 72 New Features
  • 64 Improvements

NetBeans Notes:

  • Remove duplicated jar and add dependency to java.lsp.server module, this is the only module that requires org.apache.commons.io
  • Since version 2.7 commons-io change it's Bundle-SymbolicName in the MANIFEST.MF from org.apache.commons.io to org.apache.commons.commons-io, this newly added hyphen breaks the Ant target commit-validation with the 2 respective GitHub Tasks Commit-validation (on macOS) and Commit-validation (on Linux). This should be fixed by adding a hyphen - to a regular expression in platform/openide.modules/Dependency.java line 180 but I could not make it work. I did add a two new tests to validate codename values with a hyphen and underscore. According to the spec this is a valid name:
    • name: alphanum *headerchar
    • headerchar: alphanum | - | _

Testing:

  • Full build done
  • Verify successful execution of libraries and licenses Ant test
  • Verify successful execution of unit tests for modules java/java.lsp.server (the one that use this library)
  • Checked the file is in {nb_all}/platform/modules/org-apache-commons-io.jar

Web Page Release Notes JARManifest Spec

pepness avatar Mar 16 '22 18:03 pepness

Since version 2.7 commons-io change it's Bundle-SymbolicName in the MANIFEST.MF from org.apache.commons.io to org.apache.commons.commons-io, this newly added hyphen breaks the Ant target commit-validation with the 2 respective GitHub Tasks Commit-validation (on macOS) and Commit-validation (on Linux). This should be fixed by adding a hyphen - to a regular expression in platform/openide.modules/Dependency.java line 180 but I could not make it work. I did add a two new tests to validate codename values with a hyphen and underscore. According to the spec this is a valid name. JARManifest Spec

pepness avatar Mar 22 '22 00:03 pepness

@dbalek @matthiasblaesing any thoughts?

neilcsmith-net avatar Oct 11 '22 13:10 neilcsmith-net

My gut feeling is, that it should be save to relax the naming rules for code name bases. The dash is the only character that can't be used in code name base, but the NetBeans module name. This needs further checks though.

Update - the last big change in that area is most probably this:

https://bz.apache.org/netbeans/show_bug.cgi?id=212364 https://bz.apache.org/netbeans/attachment.cgi?id=119563&action=diff

So the code-name base is already not a package anymore - further supporting my feeling

matthiasblaesing avatar Oct 11 '22 20:10 matthiasblaesing

@pepness sorry for the late reply. I had a look at this and this needs a documented API change, that will need a review, we should also rename the NetBeans module (yes commons-io broke compatibilty).

This is my suggestion how to fix it: https://github.com/matthiasblaesing/netbeans/tree/pr-3794 (this should be rebased onto master and most probably squashed). Please have a look.

matthiasblaesing avatar Oct 12 '22 20:10 matthiasblaesing

restarting CI with all tests enabled

mbien avatar Jan 12 '23 07:01 mbien

core.startup is failing, restarted it once already:

junit.framework.AssertionFailedError
    at org.netbeans.core.startup.ConsistencyVerifierTest.testIAE(ConsistencyVerifierTest.java:114)
    at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:77)
    at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:476)
    at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:402)
    at java.lang.Thread.run(Thread.java:750)

moved this to NB18. If anyone things this would be a candidate for NB17, feel free to move it back

mbien avatar Jan 12 '23 09:01 mbien

PR has conflicts

mbien avatar Jul 10 '23 16:07 mbien

moving to NB20

mbien avatar Jul 13 '23 14:07 mbien

~would be good to resolve the conflicts to get a fresh CI run in~ see below

mbien avatar Sep 22 '23 07:09 mbien

We have now #6480, the approach @lahodaj took to fix the hyphen vs. underscore problems looks easier to me and does not involve changing the netbeans module system.

matthiasblaesing avatar Sep 22 '23 18:09 matthiasblaesing

closing, since the other PR is now integrated

mbien avatar Oct 05 '23 08:10 mbien