Uploaded image for project: 'XWork'
  1. XWork
  2. XW-550

XWorkConverter: unknownMappings is out of sync with defaultMappings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.4
    • 2.1
    • Type Conversion
    • None
    • Patch, Important

    Description

      UnknownMappings is out of sync with defaultMappings. I am using annotation conversion configuration with Struts 2. Since adding to defaultMappings does not remove from unknownMappings the conversion occasionally fails. I can catch it by setting conditional break point in lookup(String) method: (unknownMappings.contains(className) && defaultMappings.containsKey(className)).

      Here is a quick patch that I had to use, although it solves the issues, it does not solve the cause. Same thing happened with 2.0.3 (before XWorkConverter was refactored).

      Index: src/java/com/opensymphony/xwork2/util/XWorkConverter.java

      ===================================================================

      — src/java/com/opensymphony/xwork2/util/XWorkConverter.java (revision 1579)

      +++ src/java/com/opensymphony/xwork2/util/XWorkConverter.java (working copy)

      @@ -344,7 +344,7 @@

      • @return a TypeConverter to handle the specified class or null if none can be found

      */

      public TypeConverter lookup(String className) {

      • if (unknownMappings.contains(className)) {

      + if (unknownMappings.contains(className) && !defaultMappings.containsKey(className))

      { return null; }

      Attachments

        Activity

          People

            rainerh Rainer Hermanns
            lukaszracon Lukasz Racon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: