Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1281

LoggerConfig.getProperties() should not allocate on each call

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: Core
    • Labels:
      None

      Description

      LoggerConfig.getProperties() is currently implemented as

      public Map<Property, Boolean> getProperties() {
          return properties == null ? null : Collections.unmodifiableMap(properties);
      }
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              remkop@yahoo.com Remko Popma
              Reporter:
              remkop@yahoo.com Remko Popma
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: