JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-555  -  No argument checking in execution policies constructors
Posted Oct 20, 2018 - updated Oct 29, 2018
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Core
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Always
  • Severity
    Normal
  • Targetted for
    icon_milestones.png JPF 6.0.1
Issue description
The constructors of the various execution policy rules perform no argument checking in their constructors. This is inconsistent with the execution policy XML schema and makes usage of the API a potential problem because default values are used for null or missing arguments.

Missing checks I have identified so far:
  • null checks
  • min/max number of arguments (e.g. AND rule should have at least 2 non-null arguments)
Steps to reproduce this issue
N/A

#3
Comment posted by
 zorba128
Oct 22, 11:08
I think setting min count to 2 is an overkill. It is perfectly fine (and common) to have:
  • AND(true) => true
  • AND(false) => false
  • OR(true) => true
  • OR(false) => false


If you think of it as calculating min/max from collection of numbers (and this is what AND/OR are for multiple booleans) it makes sense to have it working for single element collection.

So I'd just assert input is non-empty (because otherwise you should assume some starting state - what makes that non obvious).

marcin