From 88ed5de40cd24860c129196ff11fe6e64b56eda0 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Thu, 23 Apr 2026 22:17:28 +0300 Subject: [PATCH 1/3] Fix SpotBugs --- .../reportportal/service/launch/AbstractJoinedLaunch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/epam/reportportal/service/launch/AbstractJoinedLaunch.java b/src/main/java/com/epam/reportportal/service/launch/AbstractJoinedLaunch.java index f3e892cf..a391c65e 100644 --- a/src/main/java/com/epam/reportportal/service/launch/AbstractJoinedLaunch.java +++ b/src/main/java/com/epam/reportportal/service/launch/AbstractJoinedLaunch.java @@ -33,6 +33,7 @@ public class AbstractJoinedLaunch extends LaunchImpl { final LaunchIdLock lock; volatile String uuid; + private static final Random random = new Random(); private static final AtomicLong THREAD_COUNTER = new AtomicLong(); private static final ThreadFactory THREAD_FACTORY = r -> { Thread t = new Thread(r); @@ -45,8 +46,7 @@ public class AbstractJoinedLaunch extends LaunchImpl { private static ScheduledFuture getUpdateTask(String instanceUuid, long updateInterval, LaunchIdLock launchIdLock, ScheduledExecutorService service) { - Random r = new Random(); - int delay = updateInterval > Integer.MAX_VALUE ? r.nextInt(Integer.MAX_VALUE) : r.nextInt((int) updateInterval); + int delay = updateInterval > Integer.MAX_VALUE ? random.nextInt(Integer.MAX_VALUE) : random.nextInt((int) updateInterval); return service.scheduleWithFixedDelay( () -> launchIdLock.updateInstanceUuid(instanceUuid), delay, From 6d38db0798fad4bb4eb5c1b635afb6bbd72218c0 Mon Sep 17 00:00:00 2001 From: pblundell Date: Fri, 5 Jun 2026 09:50:11 +0100 Subject: [PATCH 2/3] fix: escape closing brace in TemplateProcessing regex for Android ICU compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Android's regex engine (com.android.icu.util.regex.PatternNative) is stricter than the JVM's java.util.regex.Pattern and rejects unescaped '}' with a PatternSyntaxException. Since this regex is compiled in a static initializer, the class is permanently poisoned and every subsequent call to LaunchImpl.startTestItem() fails with ExceptionInInitializerError. Escaping the '}' as '\}' is valid on both JVM and Android ICU — no behavioural change for non-Android consumers. Fixes #322 --- .../utils/formatting/templating/TemplateProcessing.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/reportportal/utils/formatting/templating/TemplateProcessing.java b/src/main/java/com/epam/reportportal/utils/formatting/templating/TemplateProcessing.java index daddaa8c..4f5ddd3c 100644 --- a/src/main/java/com/epam/reportportal/utils/formatting/templating/TemplateProcessing.java +++ b/src/main/java/com/epam/reportportal/utils/formatting/templating/TemplateProcessing.java @@ -40,7 +40,7 @@ public class TemplateProcessing { public static final String NULL_VALUE = "NULL"; - private static final Pattern TEMPLATE_GROUP = Pattern.compile("\\{([\\w$]+(\\.[\\w$]+)*)}"); + private static final Pattern TEMPLATE_GROUP = Pattern.compile("\\{([\\w$]+(\\.[\\w$]+)*)\\}"); private TemplateProcessing() { throw new IllegalStateException("Static only class"); From cdba723b2c82ae5eaf674c0b77fc726a04f2d73a Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 16 Jun 2026 13:21:28 +0300 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1a24bb7..829974fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Fixed +- Issue [#322](https://github.com/reportportal/client-java/issues/322): PatternSyntaxException on Android: unescaped '}' in TemplateProcessing regex, by @blundell ## [5.4.14] ### Changed