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

The ScopedModelDriven Interceptor is not thread safe ?

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: 2.5.x
    • Component/s: Core Interceptors
    • Labels:
      None

      Description

      Looking at the source code of the ScopedModelDriven Interceptor, I can see the following variables scoped at class level:

           private String scope;
           private String name;
           private String className;
           private ObjectFactory objectFactory;
      

      https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/interceptor/ScopedModelDrivenInterceptor.java#L85-L88

      AFAIK, this means they're not thread safe, since different requests could override those variables altering the workflow of other threads.

      Even if it's not that easy for it to happen, it seems just wrong.

      And by the way, what's the problem on having those defined at method level, and settle things once and for all ?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Andrea Ligios Andrea Ligios
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: