Skip to content

Replace usage of package org.codehaus.plexus.util.IOUtil with Java native methods.#7076

Merged
pepness merged 1 commit intoapache:masterfrom
pepness:ioutils-deprecated
Feb 24, 2024
Merged

Replace usage of package org.codehaus.plexus.util.IOUtil with Java native methods.#7076
pepness merged 1 commit intoapache:masterfrom
pepness:ioutils-deprecated

Conversation

@pepness
Copy link
Member

@pepness pepness commented Feb 17, 2024

  • Use try-with-resources instead of IOUtil.close() method
  • Use readAllBytes() instead of IOUtil.toByteArray()
  • Bump javac.source and javac.target to version 11 in module maven.checkstyle. Needed for method readAllBytes() and to use a variable inside try-with-resources
  • Add Maven as a display category to the module maven.checkstyle

NetBeans Testing:

  • Verify successful execution of libraries and licenses Ant test
  • Verify successful execution of Verify Sigtests
  • Verify successful execution of unit tests for modules maven.apisupport, maven.checkstyle, and maven
  • Started NetBeans and ensure the log didn't have any ERROR or new WARNINGS

@pepness pepness added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) Maven [ci] enable "build tools" tests labels Feb 17, 2024
@pepness pepness added this to the NB22 milestone Feb 17, 2024
@pepness pepness self-assigned this Feb 17, 2024
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. left some comments for you to consider.

@mbien mbien added the Code cleanup Label for cleanup done on the Netbeans IDE label Feb 21, 2024
- Use `try-with-resources` instead of `IOUtil.close()` method
- Use `readAllBytes()` instead of `IOUtil.toByteArray()`
- Bump `javac.source` and `javac.target` to version 11 in module
  `maven.checkstyle`. Needed for method `readAllBytes()` and to use a
  variable inside `try-with-resources`
- Add `Maven` as a display category to the module `maven.checkstyle`
- Use one wrapped stream instead of two
- Use native JDK method `Files.copy` instead of NetBeans method
  `FileUtil.copy`
@pepness pepness merged commit 61d4cd1 into apache:master Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code cleanup Label for cleanup done on the Netbeans IDE Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) Maven [ci] enable "build tools" tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments