ICEfaces
  1. ICEfaces
  2. ICE-9357

ICE Renderers have thread unsafe instance field

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Compat components

      Description

      Similarly to ICE-9348, but involving the compat components.

      As reported in the forum, this renderer uses instance fields that they read from and write to during rendering:

      - SelectInputTextRenderer

      Additionally, auditing found a problem with:

      - OutputStyleRenderer

      Renderers are application scoped, and can be used simultaneously by different requests / lifecycles. They should never use instance fields that are written to and then read from during a discrete render, since the same Renderer instance is used across threads for different views and users.

        Activity

        Hide
        Mark Collette added a comment - - edited

        Only these two were actually broken:

        icefaces3/compat/components/src/main/java/com/icesoft/faces/component/style/OutputStyleRenderer.java
        browserSpecificFilename

        /Users/mark/Documents/ICEsoft/trunk/icefaces3/compat/components/src/main/java/com/icesoft/faces/component/selectinputtext/SelectInputTextRenderer.java
        domUpdateMap

        The rest were ones that were alright but failed the stringent test set by ICE-9358.

        icefaces3 trunk
        Subversion 36235

        icefaces EE 3.3 branch tag
        Subversion 36240

        Show
        Mark Collette added a comment - - edited Only these two were actually broken: icefaces3/compat/components/src/main/java/com/icesoft/faces/component/style/OutputStyleRenderer.java browserSpecificFilename /Users/mark/Documents/ICEsoft/trunk/icefaces3/compat/components/src/main/java/com/icesoft/faces/component/selectinputtext/SelectInputTextRenderer.java domUpdateMap The rest were ones that were alright but failed the stringent test set by ICE-9358 . icefaces3 trunk Subversion 36235 icefaces EE 3.3 branch tag Subversion 36240
        Hide
        Liana Munroe added a comment -

        No Issues found in IE7 & 9, FF 3.6 or Chrome

        Show
        Liana Munroe added a comment - No Issues found in IE7 & 9, FF 3.6 or Chrome
        Hide
        Jack Van Ooststroom added a comment -

        WebSphere Application Server 8.x doesn't like the FacesContext.getInstance() invocation in a static context:

        private static final String ID_SUFFIX = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance()) + "j_idcl";

        This either needs to be a non-static, or the assignment needs to be done on a JSF thread in a non-static context.

        Show
        Jack Van Ooststroom added a comment - WebSphere Application Server 8.x doesn't like the FacesContext.getInstance() invocation in a static context: private static final String ID_SUFFIX = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance()) + "j_idcl"; This either needs to be a non-static, or the assignment needs to be done on a JSF thread in a non-static context.
        Hide
        Jack Van Ooststroom added a comment -

        See ICE-7772 for additional info.

        Show
        Jack Van Ooststroom added a comment - See ICE-7772 for additional info.
        Hide
        Jack Van Ooststroom added a comment -

        Sending icefaces/compat/components/src/main/java/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
        Transmitting file data .
        Committed revision 36439.

        Show
        Jack Van Ooststroom added a comment - Sending icefaces/compat/components/src/main/java/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java Transmitting file data . Committed revision 36439.
        Hide
        Jack Van Ooststroom added a comment -

        As ID_SUFFIX needs to be and static and final as a class member, I removed the class member altogether and replaced the two references to it with the actual code. Marking this one as FIXED again.

        Show
        Jack Van Ooststroom added a comment - As ID_SUFFIX needs to be and static and final as a class member, I removed the class member altogether and replaced the two references to it with the actual code. Marking this one as FIXED again.
        Hide
        Liana Munroe added a comment -

        Works on Tomcat7, IE 8, FF21, build 24

        Show
        Liana Munroe added a comment - Works on Tomcat7, IE 8, FF21, build 24

          People

          • Assignee:
            Mark Collette
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: