Add missing indices to message format in ModelAssembler#3877
Add missing indices to message format in ModelAssembler#3877trancexpress merged 2 commits intoeclipse-platform:masterfrom
Conversation
There was a problem hiding this comment.
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
Patternfor efficient placeholder replacement.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...les/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelAssembler.java
Show resolved
Hide resolved
|
This pull request changes some projects for the first time in this development cycle. 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 patchFurther information are available in Common Build Issues - Missing version increments. |
d8afa3b to
e53c17a
Compare
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
The fallback logging mechanism in
ModelAssembleruses: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:
This change likewise adds indices to the message format, for the fallback case.
Fixes: #3873