[ 
https://issues.apache.org/jira/browse/LOG4J2-1979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087253#comment-16087253
 ] 

Ralph Goers commented on LOG4J2-1979:
-------------------------------------

A downside to this is that this class derives from Apache Commons Lang.  Every 
now and then we look at the Lang code to see what patches have been applied and 
update this class with them. Doing this refactoring will make that somewhat 
harder to do.

> 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)

Reply via email to