Remko Popma created LOG4J2-1281:
-----------------------------------

             Summary: LoggerConfig.getProperties() should not allocate on each 
call
                 Key: LOG4J2-1281
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1281
             Project: Log4j 2
          Issue Type: Improvement
          Components: Core
    Affects Versions: 2.5
            Reporter: Remko Popma


LoggerConfig.getProperties() is currently implemented as
{code}
public Map<Property, Boolean> getProperties() {
    return properties == null ? null : Collections.unmodifiableMap(properties);
}
{code}
this creates a new {{UnmodifiableMap}} object for each call.

We can wrap the {{properties}} field with {{Collections.unmodifiableMap}} in 
the constructor, so there is no need to do this on every call.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to