Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-1495

BaseRequestItem.getTypedParameter() does not work with parameterized types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1-BETA5, 2.0.0-RC2, 2.0.0, 2.0.2
    • 2.5.3
    • Java
    • None

    Description

      For example in AppDataHandler.create() there is code like this:

      Map<String, String> values = request.getTypedParameter("data", Map.class);

      Obviously there will be no way for the underlying BeanConvertor to know what the parameterized type is.

      One way I can see to solve this is to add a new method to the BeanConvertor interface:

      public <T> T convertToObject(String json, Type type);

      So that in AppDataHandler you can do something like:

      Map<String, String> values = request.getTypedParameter("data", new TypeLiteral<Map<String, String>>);

      If this is acceptable, I will start working on a patch.

      Attachments

        Activity

          People

            Unassigned Unassigned
            myoung Michael Young
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: