Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3966

Setting oamEnableViewPool="false" causes NullPointerException in ViewPoolProcessor.pushPartialView()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.0, 2.2.7
    • 2.2.8
    • General
    • None

    Description

      In testing View Pooling, we disabled it for specific views, using <f:view oamEnableViewPool="false">. Using this tag, view pooling is disabled, but there's a NullPointerException in ViewPoolProcessor.pushPartialView(). We originally saw the issue with 2.2.0, but it persists when upgrading to 2.2.7.

      A simple patch fixed the issue for us, by checking if the viewPool is null, before executing isWorthToRecycleThisView(). Is this the preferred way to fix this defect, or will we encounter additional issues with further testing?

      diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
      index 08c10e1..b4d9025 100644
      — a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
      +++ b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
      @@ -447,7 +447,7 @@ public void pushPartialView(FacesContext context, UIViewRoot view, FaceletState
      {
      ViewPool viewPool = getViewPool(context, view);

      • if (viewPool.isWorthToRecycleThisView(context, view))
        + if (viewPool != null && viewPool.isWorthToRecycleThisView(context, view))
        {
        ViewStructureMetadata viewStructureMetadata = null;
        if (faceletViewState == null)

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            kulinski Chris Kulinski
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: