You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by "Minto van der Sluis (JIRA)" <ji...@apache.org> on 2013/02/13 13:50:12 UTC

[jira] [Created] (STANBOL-928) Null list on RuleStore RecipeImpl

Minto van der Sluis created STANBOL-928:
-------------------------------------------

             Summary: Null list on RuleStore RecipeImpl
                 Key: STANBOL-928
                 URL: https://issues.apache.org/jira/browse/STANBOL-928
             Project: Stanbol
          Issue Type: Bug
          Components: Rules
            Reporter: Minto van der Sluis


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


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira