Skip to content

Add missing indices to message format in ModelAssembler#3877

Merged
trancexpress merged 2 commits intoeclipse-platform:masterfrom
trancexpress:gh3873
Apr 9, 2026
Merged

Add missing indices to message format in ModelAssembler#3877
trancexpress merged 2 commits intoeclipse-platform:masterfrom
trancexpress:gh3873

Conversation

@trancexpress
Copy link
Copy Markdown
Contributor

The fallback logging mechanism in ModelAssembler uses:

java.text.MessageFormat.format(String, Object...)

Supplied message formats bind arguments without an index, i.e. message formats use {} instead of {n}.
This causes a NFE in MessageFormat.format(),
resulting in no log output in the fallback case.

In the usual case with an available logger, the indices are added by:

com.sun.org.slf4j.internal.Logger.addIndex(String)

This change likewise adds indices to the message format, for the fallback case.

Fixes: #3873

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes fallback logging in ModelAssembler when no LogService/Logger is available by ensuring the message pattern is valid for java.text.MessageFormat, preventing IllegalArgumentException/NumberFormatException and restoring fallback log output.

Changes:

  • Add a helper to transform SLF4J-style {} placeholders into indexed {n} placeholders.
  • Apply that transformation in the fallback MessageFormat.format(...) logging path.
  • Introduce a precompiled regex Pattern for efficient placeholder replacement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@eclipse-platform-bot
Copy link
Copy Markdown
Contributor

eclipse-platform-bot commented Apr 8, 2026

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From b572442b43d6d9a9b2fa723d58fd9826aaeacd42 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Thu, 9 Apr 2026 07:34:33 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF
index 844d05c5e4..e2fe621770 100644
--- a/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-SymbolicName: org.eclipse.e4.ui.workbench;singleton:=true
-Bundle-Version: 1.18.200.qualifier
+Bundle-Version: 1.18.300.qualifier
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Test Results

   852 files  ±0     852 suites  ±0   55m 46s ⏱️ - 3m 26s
 7 894 tests ±0   7 651 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 184 runs  ±0  19 529 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit 10937f5. ± Comparison against base commit f1a031a.

♻️ This comment has been updated with latest results.

@trancexpress trancexpress force-pushed the gh3873 branch 2 times, most recently from d8afa3b to e53c17a Compare April 9, 2026 06:33
The fallback logging mechanism in ModelAssembler uses:

java.text.MessageFormat.format(String, Object...)

Supplied message formats bind arguments without an index,
i.e. message formats use "{}" instead of "{n}".
This causes a NFE in MessageFormat.format(),
resulting in no log output in the fallback case.

In the usual case with an available logger, the indices are added by:

com.sun.org.slf4j.internal.Logger.addIndex(String)

This change likewise adds indices to the message format,
for the fallback case.

Fixes: eclipse-platform#3873
@trancexpress trancexpress merged commit f706c26 into eclipse-platform:master Apr 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fallback logging in ModelAssembler should fulfill MessageFormat constraints

3 participants