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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: