Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-928

Null list on RuleStore RecipeImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.12.0
    • Rules
    • None

    Description

      Hi folks,

      Is there a specific reason why Recipe.getRuleList() can return null
      instead of an empty list?

      Looking at the code of RecipeImpl it seems to be inconsistent.

      a) getRuleList() returns null if there are no rules.

      public RuleList getRuleList()

      { return ruleList; }

      b) getRuleNames() and listRuleIDs() returns and empty list if there are
      no rules.

      @Override
      public List<UriRef> listRuleIDs() {
      if (ruleList != null && !ruleList.isEmpty())

      { ... }

      else

      { return Collections.emptyList(); }

      }

      Personally I prefer getRuleList() to also always return a possibly empty
      list.

      Regards,

      Minto

      Attachments

        1. RecipeImpl.patch
          4 kB
          Minto van der Sluis

        Activity

          People

            reto Reto Gmür
            misl Minto van der Sluis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: