Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-203

MessageFormat.format throws Exception when attempting to parse parameters

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • None
    • 1.6.x
    • jul-to-slf4j
    • None
    • Operating System: Mac OS X 10.3
      Platform: PC

    Description

      I am trying to bridge a LogRecord with a message that is the result of HashMap.toString():

      {interface com.google.code.morphia.annotations.Id=@com.google.code.morphia.annotations.Id()}

      and get following exception

      Caused by: java.lang.IllegalArgumentException: can't parse argument number interface com.google.code.morphia.annotations.Id=@com.google.code.morphia.annotations.Id()
      at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)
      at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
      at java.text.MessageFormat.<init>(MessageFormat.java:350)
      at java.text.MessageFormat.format(MessageFormat.java:811)
      at org.slf4j.bridge.SLF4JBridgeHandler.getMessageI18N(SLF4JBridgeHandler.java:233)

      FIX: do not format since there are no parameters!

      if (params != null && params.length > 0)

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            kristof.pelckmans@wondergraphs.com Kristof Pelckmans
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: