You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2017/12/31 05:29:00 UTC

[jira] [Resolved] (LOG4J2-1979) Refactoring of StrSubstitutor

     [ https://issues.apache.org/jira/browse/LOG4J2-1979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers resolved LOG4J2-1979.
---------------------------------
    Resolution: Not A Problem

Resolving since I don't see any action being taken on this.

> Refactoring of StrSubstitutor
> -----------------------------
>
>                 Key: LOG4J2-1979
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1979
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>            Reporter: João Paulo Lemes Machado
>
> Hello everyone.
> I was analyzing the modularization of some classes, and I identified that the class StrSubstitutor has an opportunity for cohesion improvement. 
> The class ParameterizedMessage was in the same situation and the problem was solved as follows: The ParameterFormatter class was created, and several get() and set() methods that were used only to configure the class parameters were moved from ParameterizedMessage to ParameterFormatter. 
> The new class was then accessed through an instance variable in ParameterizedMessage. This strategy has cleaned and improved ParameterizedMessage cohesion.
> With this in mind, I would recommend creating a new class: StrSubstitutorConfig , and moving the following methods:
> setVariableSuffixMatcher
> setEscapeChar
> getValueDelimiterMatcher
> setVariableSuffix
> setValueDelimiter
> setVariableResolver
> getVariableResolver
> getVariablePrefixMatcher
> setVariablePrefix
> setVariableSuffix
> setValueDelimiter
> setEnableSubstitutionInVariables
> setConfiguration
> setVariablePrefix
> getVariableSuffixMatcher
> getChars
> setVariablePrefixMatcher
> setValueDelimiterMatcher
> getEscapeChar
> from the StrSubstitutor.
> Those parameters accessed by an instance variable in the StrSubstitutor.
> Moreover, the orthogonality is the design would be enhanced.
> What do you think about that?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)