Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1308

Unnecessary null check in EffectiveNodeType.getApplicableChildNodeDef()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.4
    • 1.5
    • jackrabbit-core
    • None

    Description

      This is just a trivial thing I noticed this while inspecting the code. getApplicableChildNodeDef() says:

      // try named node definitions first
      ItemDef[] defs = getNamedItemDefs(name);
      if (defs != null) {

      but getNamedItemDefs() is currently defined to not return null:

      public ItemDef[] getNamedItemDefs(Name name) {
      List defs = (List) namedItemDefs.get(name);
      if (defs == null || defs.size() == 0)

      { return ItemDef.EMPTY_ARRAY; }

      return (ItemDef[]) defs.toArray(new ItemDef[defs.size()]);
      }

      I didn't check to see if there were any other unnecessary null checks.

      Attachments

        Activity

          People

            jukkaz Jukka Zitting
            eburnette Ed Burnette
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: