Replace java.net.URL with java.net.URI in LstFileLoader.java #6934
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The aim of this PR is to prepare to migration from Java 17 to Java 21 (LTS) that might happen in future. JDK deprecates URL constructors, and replaces them with URI.
The next step of this PR was to improve error messages (some formatting) for LST files processing. Now all LST files have UTF-8 (some of them were ANSI or UTF-8-BOM), and this forced us to use a 3rd party (Apache) library to handle different encodings.
Current tests (integration, unit etc) are "green" (at least on my machine), and all LST files don't have warnings related to a wrong/unexpected encoding. So in theory, if you create a new LST file, and its codepage doesn't match to UTF-8, you will get either an error (if it is completely weird codepage), or a warning (if it has a BOM-character).
Please review and merge this PR, but squash the changes.
Thanks
p.s. it is just a thought, but I was thinking about a parallel handling of LST files using Java Streams. The NIO API suits this purpose better than the old API that Apache provided. Plus I want to get rid of redundant dependencies, if I can.
@karianna