Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2581

add generics to RequestAware, SessionAware, and ParameterAware

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.1.2
    • Core Interceptors
    • None

    Description

      Since Struts2 targets Java 1.5, it would be great if RequestAware, SessionAware, and ParameterAware could be updated to use generics.

      Each defines a setter which takes a Map, but the Map does not use generics.

      Problem:
      When implementing these methods, developers must add a @SuppressWarnings("unchecked") to the method to compile without warnings.

      Suggested fix: change the method signatures to use generics.

      RequestAware.setRequest(Map<String, Object> request);
      SessionAware.setSession(Map<String, Object> session);
      ParameterAware.setParameters(Map<String, String[]> parameters);

      Attachments

        1. ApplicationAware.patch
          0.1 kB
          Brad Cupit

        Activity

          People

            mrdon Donald J. Brown
            bradcupit Brad Cupit
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: