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

LoggerConfig.getProperties() should not allocate on each call

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 2.6
    • Core
    • 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

            rpopma Remko Popma
            rpopma Remko Popma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: