Skip to content

Remove usage of ParameterizedMessage in server #86549

@ChrisHegarty

Description

@ChrisHegarty

A common use of ParameterizedMessage in the ES codebase is to facilitate lazy evaluation of message arguments. ParameterizedMessage predates some of the newer lambda shaped Supplier-accepting log variants. Quite often using a String or argument Supplier is just as good, more readably, and likely slightly more efficient.

Within server there are the following usages:

$ find server/src/main/java/ -name "*.java" -exec grep org.apache.logging.log4j.message.ParameterizedMessage {} \; -print | grep -e "\.java$" | sed "s/\/[a-zA-Z0-9]*.java$//" | sort | uniq | sed "s/^server/- [ ] server/" 

for majority of use case a structured replace refactoring from intellij will be good option

relates #84478

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions