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

Exception when mixing varargs and non-varargs overloads

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.1
    • 2.6.2
    • Core
    • None

    Description

      There is a bug with the way parameters are swapped in and out of reusable parameterised messages, if there is a mixture of log statements using varargs and non-varargs overloads.

      To reproduce, run the following and observe that the third log statement throws an exception.

      logger.info("Test {}", new Object[]

      { 1 }

      );
      logger.info("Test {} {}", Unbox.box(1), Unbox.box(2));
      logger.info("Test {} {}", Unbox.box(1), Unbox.box(2));

      Attachments

        Activity

          People

            Unassigned Unassigned
            nick.chadwick@nichesolutions.co.uk Nick Chadwick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: