In the release of Axon Ivy LTS 10.0.19 we fixed many security issues. We had to update Apache Commons Compress to 1.26.0 due to CVE-2024-25710 and CVE-2024-26308.
Since Apache Commons Compress depends on Apache Commons IO, we were also forced to upgrade that library from 2.11.0 to 2.15.1.
And there are some breaking changes in this upgrade. Hopefully, these breaking changes are not used very often in projects, so we decided to upgrade to be on the safe side.
In addition to many deprecations that do not break, there is at least one method that does break. It still runs when already compiled and deployed, but when opened in the Designer, this code now gives a compile error:
public static List<String> readLines(InputStream inputStream) {
try {
return IOUtils.readLines(inputStream, StandardCharsets.UTF_8);
} catch (IOException ex) {
Ivy.log().error("Could not read lines form inputstream", ex);
return List.of();
}
}
You need to change it from catching an IOException
to UncheckedIOException
:
public static List<String> readLines(InputStream inputStream) {
try {
return IOUtils.readLines(inputStream, StandardCharsets.UTF_8);
} catch (UncheckedIOException ex) {
Ivy.log().error("Could not read lines form inputstream", ex);
return List.of();
}
}
Or mostly, if you do not have a good compensation anyway, leave the UncheckedIOException
(RuntimeException) unhandled:
public static List<String> readLines(InputStream inputStream) {
return IOUtils.readLines(inputStream, StandardCharsets.UTF_8);
}
If you find other examples, please add them here.