ICEfaces
  1. ICEfaces
  2. ICE-9348

ACE Renderers have thread unsafe instance field

    Details

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

      Description

      As reported in the forum, these renderers use instance fields that they read from and write to during rendering:

      - TextAreaEntryRenderer
      - SliderEntryRenderer
      - PanelRenderer
      - DateTimeEntryRenderer
      - CheckboxButtonRenderer
      - CellEditorRenderer

      A common pattern found in some of them is to use this code:

      public class DateTimeEntryRenderer extends InputRenderer {
          private Map<String, Object> domUpdateMap = new HashMap<String, Object>();

      Which involves the encode methods using the domUpdateMap to create a hashcode. The domUpdateMap should be declared inside the methods, which might involve re-arranging code between the encodeBegin and encodeEnd methods.

      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.

      We'll need to audit all of our ACE Renderers, as the forum posting might not have been comprehensive.

        Activity

        Hide
        Nils Lundquist added a comment -

        Revision #36189
        Committed by nils.lundquist
        3 minutes ago ICE-9348 - Removed CellEditorRenderer state.

        Show
        Nils Lundquist added a comment - Revision #36189 Committed by nils.lundquist 3 minutes ago ICE-9348 - Removed CellEditorRenderer state.
        Hide
        Mark Collette added a comment -

        Also, MessageRenderer and MessagesRenderer use:

        private Logger logger = Logger.getLogger(this.getClass().getName());

        whereas the rest of our code uses static Logger instances. This shouldn't be an issue though.

        Show
        Mark Collette added a comment - Also, MessageRenderer and MessagesRenderer use: private Logger logger = Logger.getLogger(this.getClass().getName()); whereas the rest of our code uses static Logger instances. This shouldn't be an issue though.
        Hide
        yip.ng added a comment -

        This was done on purpose to avoid hard coding the logger name. (See the use of this?) I have seen too many cases where the line is just copied and pasted without changing the logger name, leading to misleading log messages.

        Show
        yip.ng added a comment - This was done on purpose to avoid hard coding the logger name. (See the use of this ?) I have seen too many cases where the line is just copied and pasted without changing the logger name, leading to misleading log messages.
        Hide
        yip.ng added a comment -

        DateTimeEntryRenderer done.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#36194

        M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#36195

        Show
        yip.ng added a comment - DateTimeEntryRenderer done. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#36194 M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#36195
        Hide
        Arturo Zambrano added a comment -

        Committed fix for PanelRenderer.java at revision 36201 to the trunk and at revision 36202 to the 3.3 EE tag.

        Show
        Arturo Zambrano added a comment - Committed fix for PanelRenderer.java at revision 36201 to the trunk and at revision 36202 to the 3.3 EE tag.
        Hide
        yip.ng added a comment -

        TextAreaEntryRenderer done.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\renderkit\InputRenderer.java#36203
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryRenderer.java#36203

        M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\renderkit\InputRenderer.java#36204
        M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryRenderer.java#36204

        Show
        yip.ng added a comment - TextAreaEntryRenderer done. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\renderkit\InputRenderer.java#36203 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryRenderer.java#36203 M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\renderkit\InputRenderer.java#36204 M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryRenderer.java#36204
        Hide
        yip.ng added a comment -

        Message renderers done.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\growlmessages\GrowlMessagesMeta.java#36218
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\growlmessages\GrowlMessagesRenderer.java#36218
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\message\MessageRenderer.java#36218
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\messages\MessagesRenderer.java#36218

        M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\message\MessageRenderer.java#36219
        M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\messages\MessagesRenderer.java#36219

        Show
        yip.ng added a comment - Message renderers done. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\growlmessages\GrowlMessagesMeta.java#36218 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\growlmessages\GrowlMessagesRenderer.java#36218 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\message\MessageRenderer.java#36218 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\messages\MessagesRenderer.java#36218 M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\message\MessageRenderer.java#36219 M: http:\\10.18.39.25:8888\svn\ossrepo\icefaces-ee\tags\icefaces-ee-3.3.0.GA\icefaces\ace\component\src\org\icefaces\ace\component\messages\MessagesRenderer.java#36219
        Hide
        Arturo Zambrano added a comment -

        Committed fix for SliderEntryRenderer.java at revision 36217 to the trunk and at revision 36220 to the 3.3 EE tag.

        Show
        Arturo Zambrano added a comment - Committed fix for SliderEntryRenderer.java at revision 36217 to the trunk and at revision 36220 to the 3.3 EE tag.
        Hide
        Mark Collette added a comment - - edited

        Due to the new automated test in ICE-9358 that is overly stringent, many renderers that are not broken needed to be modified to satisfy the test.

        icefaces3 trunk
        Subversion 36236,36238.

        icefaces EE 3.3 branch tag
        Subversion 36241

        Show
        Mark Collette added a comment - - edited Due to the new automated test in ICE-9358 that is overly stringent, many renderers that are not broken needed to be modified to satisfy the test. icefaces3 trunk Subversion 36236,36238. icefaces EE 3.3 branch tag Subversion 36241
        Hide
        Ken Fyten added a comment -

        Single remaining issue is the ace:checkboxButton renderer, assigned to Nils:

        WARNING: For class org.icefaces.ace.component.checkboxbutton.CheckboxButtonRenderer, the field 'uiParamChildren' is not declared 'static final'. Renderer classes must not have instance fields, and must be re-entrant.

        Show
        Ken Fyten added a comment - Single remaining issue is the ace:checkboxButton renderer, assigned to Nils: WARNING: For class org.icefaces.ace.component.checkboxbutton.CheckboxButtonRenderer, the field 'uiParamChildren' is not declared 'static final'. Renderer classes must not have instance fields, and must be re-entrant.
        Hide
        Nils Lundquist added a comment -

        Revision #36260
        Committed by nils.lundquist
        Moments ago
        ICE-9348 - Changed useless uiParamChildren variable placement.

        Revision #36261
        Committed by nils.lundquist
        Moments ago
        ICE-9348 - Changed useless uiParamChildren variable placement

        Show
        Nils Lundquist added a comment - Revision #36260 Committed by nils.lundquist Moments ago ICE-9348 - Changed useless uiParamChildren variable placement. Revision #36261 Committed by nils.lundquist Moments ago ICE-9348 - Changed useless uiParamChildren variable placement

          People

          • Assignee:
            Nils Lundquist
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: