Wicket
  1. Wicket
  2. WICKET-4864

'format' not set in ConversionException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.3.0
    • Component/s: wicket-datetime
    • Labels:
      None

      Description

      There are two DateConverter implementations in wicket:
      [1] wicket.util.convert.DateConverter
      [2] wicket.datetime.DateConverter

      When an error occures while converting the input, both throw a ConversionException. This ConversionException has a property called 'format' which is later used to get a localized pattern for error messages. But since they base on different formatter classes (jdk/joda-time), the formatter of [2] is incompatible to the format property.

      So I can see 2 ways of solving this issue:
      1. put an already localized pattern as a variable (also named 'format') in ConversionException (using ConversionException .setVariable() - those variables are later also applied to the error message)
      2. Alter the class ConversionException so its property 'format' holds the localized pattern as a string, instead of an instance of SimpleDateFormat

      1. DateConverter.patch
        1 kB
        Benedikt Schlegel

        Activity

        Benedikt Schlegel created issue -
        Benedikt Schlegel made changes -
        Field Original Value New Value
        Description There are two DateConverter implementations in wicket:
        [1] wicket.util.DateConverter
        [2] wicket.datetime.DateConverter

        When an error occures while converting the input, both throw a ConversionException. This ConversionException has a property called 'format' which is later used to get a localized pattern for error messages. But since they base on different formatter classes (jdk/joda-time), the formatter of [2] is incompatible to the format property.

        So I can see 2 ways of solving this issue:
        1. put an already localized pattern as a variable (also named 'format') in ConversionException (using ConversionException .setVariable() - those variables are later also applied to the error message)
        2. Alter the class ConversionException so its property 'format' holds the localized pattern as a string, instead of an instance of SimpleDateFormat
        There are two DateConverter implementations in wicket:
        [1] wicket.util.convert.DateConverter
        [2] wicket.datetime.DateConverter

        When an error occures while converting the input, both throw a ConversionException. This ConversionException has a property called 'format' which is later used to get a localized pattern for error messages. But since they base on different formatter classes (jdk/joda-time), the formatter of [2] is incompatible to the format property.

        So I can see 2 ways of solving this issue:
        1. put an already localized pattern as a variable (also named 'format') in ConversionException (using ConversionException .setVariable() - those variables are later also applied to the error message)
        2. Alter the class ConversionException so its property 'format' holds the localized pattern as a string, instead of an instance of SimpleDateFormat
        Benedikt Schlegel made changes -
        Attachment DateConverter.patch [ 12553555 ]
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.3.0 [ 12323327 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Benedikt Schlegel
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development