From 56bbb39700646ddcda930fdab833c3169c1a0b5a Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Fri, 10 May 2024 13:10:51 +0300 Subject: [PATCH] Overcome 'String too large to record' issue with Truffle This is better than the current state, but it is not yet the absolutely correct Relates: #39387 --- .../deployment/steps/ClassPathSystemPropBuildStep.java | 7 +++---- .../quarkus/runtime/ClassPathSystemPropertyRecorder.java | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassPathSystemPropBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassPathSystemPropBuildStep.java index feda25cbade14..dccb19214baec 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassPathSystemPropBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/ClassPathSystemPropBuildStep.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; import io.quarkus.deployment.annotations.BuildProducer; @@ -46,8 +45,8 @@ public void set(List setCPItems, } } - String classPathValue = Stream.concat(parentFirst.stream(), regular.stream()).map(p -> p.toAbsolutePath().toString()) - .collect(Collectors.joining(":")); - recorder.set(classPathValue); + List allJarPaths = Stream.concat(parentFirst.stream(), regular.stream()).map(p -> p.toAbsolutePath().toString()) + .toList(); + recorder.set(allJarPaths); } } diff --git a/core/runtime/src/main/java/io/quarkus/runtime/ClassPathSystemPropertyRecorder.java b/core/runtime/src/main/java/io/quarkus/runtime/ClassPathSystemPropertyRecorder.java index fdca4fcb0cb65..c5f17f4b8d0f6 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/ClassPathSystemPropertyRecorder.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/ClassPathSystemPropertyRecorder.java @@ -1,11 +1,13 @@ package io.quarkus.runtime; +import java.util.List; + import io.quarkus.runtime.annotations.Recorder; @Recorder public class ClassPathSystemPropertyRecorder { - public void set(String value) { - System.setProperty("java.class.path", value); + public void set(List allJarPaths) { + System.setProperty("java.class.path", String.join(":", allJarPaths)); } }