This is an automated email from the ASF dual-hosted git repository.
apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 519e2950fe1 CAMEL-22184 - avoid IndexOutBoundException in Camel Jbang
update list
519e2950fe1 is described below
commit 519e2950fe1734ecd0c2956a20c77aae1290591f
Author: Aurélien Pupier <[email protected]>
AuthorDate: Fri Jun 20 10:18:41 2025 +0200
CAMEL-22184 - avoid IndexOutBoundException in Camel Jbang update list
it doesn't fix the potential root cause, so maybe an update version will
be missing but at least it avoids to break existing feature when the
list of upgrade recipes is modified (in some ways that I have not
defined yet)
Signed-off-by: Aurélien Pupier <[email protected]>
---
.../camel/dsl/jbang/core/commands/update/UpdateList.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/update/UpdateList.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/update/UpdateList.java
index f412d5c32ff..9939869ddb5 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/update/UpdateList.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/update/UpdateList.java
@@ -136,13 +136,15 @@ public class UpdateList extends CamelCommand {
recipesVersions.quarkusUpdateRecipes().forEach(l -> {
List<String[]> runtimeVersions =
recipesVersions.qVersions().stream().filter(v -> v[1].startsWith(l.version()))
.collect(Collectors.toList());
- runtimeVersions.sort(Comparator.comparing(o -> o[1]));
- String[] runtimeVersion =
runtimeVersions.get(runtimeVersions.size() - 1);
- // Quarkus may release patches independently, therefore, we do
not know the real micro version
- String quarkusVersion = runtimeVersion[1];
- quarkusVersion = quarkusVersion.substring(0,
quarkusVersion.lastIndexOf('.')) + ".x";
-
- rows.add(new Row(runtimeVersion[0], "Camel Quarkus",
quarkusVersion, l.description()));
+ if (!runtimeVersions.isEmpty()) {
+ runtimeVersions.sort(Comparator.comparing(o -> o[1]));
+ String[] runtimeVersion =
runtimeVersions.get(runtimeVersions.size() - 1);
+ // Quarkus may release patches independently, therefore,
we do not know the real micro version
+ String quarkusVersion = runtimeVersion[1];
+ quarkusVersion = quarkusVersion.substring(0,
quarkusVersion.lastIndexOf('.')) + ".x";
+
+ rows.add(new Row(runtimeVersion[0], "Camel Quarkus",
quarkusVersion, l.description()));
+ }
});
}