slachiewicz opened a new pull request, #2274:
URL: https://github.com/apache/maven-resolver/pull/2274

   Part of #2272. Stacked on #2273, which it needs for `HttpTransporterTest` to 
stay under checkstyle's file-length limit; the test source sets follow in a 
separate PR.
   
   The main source sets compiled with 94 deprecation warnings in a clean build 
(the per-PR annotations show ten of them, and javac's default `-Xmaxwarns` 
hides the rest). After this PR a clean `mvn install` on JDK 21 with `-Xmaxwarns 
100000` prints none from `src/main`. Per bucket:
   
   - Overrides of the deprecated `getPathFor*` methods of 
`LocalRepositoryManager` (`SimpleLocalRepositoryManager`, 
`EnhancedLocalRepositoryManager`, `ChainedLocalRepositoryManager`, 
`TestLocalRepositoryManager`) carry `@Deprecated`; javac treats an override as 
a use.
   - Legacy configuration keys that are still read as fallbacks 
(`CONFIG_PROP_THREADS`, the named-lock `CONFIG_PROP_FACTORY_KEY`, 
`CONFIG_PROP_TIME`, `CONFIG_PROP_TIME_UNIT`, the JDK transporter's 
`CONFIG_PROP_HTTP_VERSION`) are read through a local annotated 
`@SuppressWarnings("deprecation")`, so the suppression covers one statement and 
says why.
   - `NamedLocksTrackingFileManager` writes its tracking file through the 
`PathProcessor` instead of the deprecated `FileUtils`; 
`TrackingFileManagerSupplier` takes the processor by injection, and both 
`RepositorySystemSupplier`s pass theirs. The old constructors stay and use 
`DefaultPathProcessor`.
   - `TestLocalRepositoryManager` and the shared `HttpTransporterTest` move to 
the `Path` API and JUnit's `@TempDir`; `AbstractArtifact.getPath()` keeps 
delegating to `getFile()` for third-party subclasses and says so.
   - `WagonTransporter` reads `getDataPath()`, the GnuPG generator uses the 
BouncyCastle signature-generator constructor that takes the signing key, and 
the Redisson lock uses the `Duration`-based `tryAcquire`.
   - The Maven 3 supplier uses the provider constructor that takes relocation 
sources and descriptor decorators, wiring the same two relocation sources the 
deprecated constructor installed (checked against the 3.10.0 bytecode) and no 
decorators. The Maven 4 supplier keeps wiring the `maven-resolver-provider` and 
`maven-model-builder` components that Maven 4 deprecated in favour of 
`maven-impl`; that class is suppressed as a whole, with the reason in its 
Javadoc, until the supplier moves there.
   - Demos use `getPath`, `setPath` and `getPaths`.
   
   Two things worth knowing for review: the modules compile with `--release 8`, 
under which javac reports an import of a deprecated type even inside a 
`@Deprecated` or suppressed class, so `DefaultFileProcessor` and 
`TestFileProcessor` refer to the deprecated SPI types by their fully qualified 
names. And the Windows job's log never showed the supplier, Wagon, GnuPG and 
demo modules, so the first count in #2272 was low.
   
   Verified: clean `mvn install` (unit tests, no ITs) on JDK 21 (macOS) → BUILD 
SUCCESS, 2272 tests, 0 failures; `grep 'has been deprecated' | grep /src/main/` 
on the log → empty.
   
   ---
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
   


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

Reply via email to