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:54:12 UTC
[jira] [Updated] (STANBOL-928) Null list on RuleStore RecipeImpl
[ https://issues.apache.org/jira/browse/STANBOL-928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Minto van der Sluis updated STANBOL-928:
----------------------------------------
Attachment: RecipeImpl.patch
Working default with an empty list prevents a lot of null checking.
> 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
> Attachments: RecipeImpl.patch
>
>
> 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