Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2151

PageInfo and JspApplicationContextImpl are creating unshared ExpressionFactory instances

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • Jastow 2.2.3.Final
    • Jastow 2.2.1.Final
    • None
    • None

      The commit resolving UNDERTOW-2106 changed the method calls in PageInfo and JspApplicationContextImpl from ELManager.getExpressionFactory() to ExpressionFactory.newInstance(). Both calls result in an ExpressionFactory impl of the same type, constructed with the same set of properties, but the former call will return an already existing object if one exists, while the latter will create a new object.

      This breaks the Faces TCK, which has tests that call JspFactory.getDefaultFactory().getJspApplicationContext(servletContext).getExpressionFactory() and jakarta.faces.application.Application.getExpressionFactory() and checks that the objects are equal. The UNDERTOW-2106 change means they are not equal as they are different instances.

      TBH, the TCK tests may be invalid as it's not clear why these objects must be equal. But they've been around since at least EE 8, so challenging them may be unproductive.

      Regardless of the Faces TCK, bypassing a cache and creating a new object seems wasteful. Looking at https://github.com/undertow-io/jastow/commit/98ecae61ea1ad8dc7eb4be39c18a380df2dc9f9d it doesn't seem like the change in method call was necessary for what the rest of the commit was about.

              bstansbe@redhat.com Brian Stansberry
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: