Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-2080

NullPointerException from skinning framework code (SkinUtils)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0-beta-2
    • 2.0.0-core
    • Skinning
    • None
    • n/a

    Description

      In our application, where we use Trinidad, we hit on the following exception...

      Mar 10, 2011 1:25:33 PM org.apache.myfaces.trinidad.webapp.TrinidadFilter
      SEVERE:
      java.lang.NullPointerException
      at org.apache.myfaces.trinidadinternal.skin.SkinUtils._registerSkinExtensionsA
      ndAdditions(SkinUtils.java:379)
      at org.apache.myfaces.trinidadinternal.skin.SkinUtils.registerSkinExtensions(S
      kinUtils.java:129)
      at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.init(Glob
      alConfiguratorImpl.java:406)
      at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.init(Registrat
      ionFilter.java:53)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.init(Trinidad
      FilterImpl.java:110)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.init(TrinidadFilter.java:
      54)

      The culprit code is here...

      private static void _registerSkinExtensionsAndAdditions(
      ExternalContext context,
      SkinFactory skinFactory)
      {
      if (context == null)
      return;

      // Add META-INF/trinidad-skins.xml skins to skin factory. (sorted first to make sure
      // we register the most 'base' skins first)
      if (_LOG.isFine()) _LOG.fine("Parse META-INF/trinidad-skins.xml files");
      List<SkinsNode> metaInfSkinsNodeList = _getMetaInfSkinsNodeList();
      // Go through each SkinsNode object
      // (contains List of SkinNodes and List of SkinAdditionNodes)
      // and return a List of the SkinNodes.
      List<SkinNode> metaInfSkinNodes = new ArrayList<SkinNode>();
      for (SkinsNode skinsNode : metaInfSkinsNodeList)

      { metaInfSkinNodes.addAll(skinsNode.getSkinNodes()); }

      ----------------

      addAll (from its doc) assumes that supplied collection is non-null. The supplier does not guarantee this, so we will need some defensive code here to avoid the NPE.
      Will provide a patch.

      Attachments

        1. npe_JIRA-2080.patch
          5 kB
          Prakash Udupa

        Activity

          People

            jeanne.waldman@oracle.com Jeanne Waldman
            pudupa Prakash Udupa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified