slachiewicz opened a new issue, #2272: URL: https://github.com/apache/maven-resolver/issues/2272
### Affected version master ### Bug description The root POM compiles with `-Xlint:deprecation` ([pom.xml](https://github.com/apache/maven-resolver/blob/master/pom.xml#L719)), but a full build on master emits 233 deprecation warning lines, 211 distinct source locations in 50 files (counted from the `windows-latest` job of [run 42168114705](https://github.com/apache/maven-resolver/actions/runs/42168114705)). GitHub shows ten of them as annotations on every PR. At that volume a new misuse of a deprecated API is invisible, so the lint no longer does what it was enabled for. The usages split by intent, and the fix differs per bucket. Main source sets, 51 locations: - Overrides of the four deprecated `getPathFor*` methods of `LocalRepositoryManager` in `SimpleLocalRepositoryManager`, `ChainedLocalRepositoryManager` and `TestLocalRepositoryManager`. Javac treats an override as a use; the overrides get `@Deprecated`, which is also the right signal to subclasses. - Implementations of the deprecated `FileProcessor` (`DefaultFileProcessor`, `TestFileProcessor`) and uses of the deprecated `FileUtils` (`NamedLocksTrackingFileManager`). The deprecated implementations get the annotation; the live class moves to `PathUtils`. - Deprecated configuration keys read as fallbacks so that old settings keep working (`CONFIG_PROP_THREADS`, `CONFIG_PROP_FACTORY_KEY`, `CONFIG_PROP_TIME`, `CONFIG_PROP_TIME_UNIT`, `CONFIG_PROP_HTTP_VERSION`). These stay and get `@SuppressWarnings("deprecation")` with a comment naming the compatibility reason. - `AbstractArtifact.getPath()` calls `getFile()` on purpose as the bridge for third-party subclasses. Suppressed, not changed. - Test support on the `File` API: `TestLocalRepositoryManager` (`getBasedir`, `setFile`) and the shared `HttpTransporterTest` (`TestFileUtils` helpers). Migrated to `getBasePath`, `setPath` and `@TempDir`. - Redisson's `RSemaphore.tryAcquire(int, long, TimeUnit)`. Migrated to the current signature. Test source sets, 160 locations: - Tests whose subject is a deprecated class (`NearestVersionSelector`, the node list generators, the scope and optional selectors, `PredicateVersionFilter`, the Hazelcast factories, `DefaultFileProcessor`, `FileUtils`). Suppressed at class level; they go away with the class. - Tests that exercise the `File`-based API on purpose, mostly in `DefaultArtifactResolverTest`. Suppressed per method so the compatibility path stays covered. - Convenience usages (`TestFileUtils.createTempFile`, `writeString`, `createTempDir`, the `LocalRepository(String)` and `LocalRepository(File)` constructors, `setFile`/`getFile` on artifacts and results, `DefaultMetadata` and `TransferResource` constructors taking `File`). Migrated to `@TempDir`, `Path`, `setPath` and the `Path` constructors. Done means a full `mvn verify` on master prints no `[deprecation]` warning. One PR covers the main source sets, one the test source sets; both link here. -- 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]
