You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2016/02/19 16:42:18 UTC

[jira] [Resolved] (LOG4J2-1281) LoggerConfig.getProperties() should not allocate on each call

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

Remko Popma resolved LOG4J2-1281.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.6

Fixed in master in commit 3458ea9.

> 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
>            Assignee: Remko Popma
>             Fix For: 2.6
>
>
> 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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org