[jboss-jira] [JBoss JIRA] (JBRULES-3505) Planner: DroolsScoreDirector's score corruption analysis returns the wrong lacking size

Cedric Hurst (JIRA) jira-events at lists.jboss.org
Mon May 14 23:09:17 EDT 2012


Cedric Hurst created JBRULES-3505:
-------------------------------------

             Summary: Planner: DroolsScoreDirector's score corruption analysis returns the wrong lacking size
                 Key: JBRULES-3505
                 URL: https://issues.jboss.org/browse/JBRULES-3505
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-planner
    Affects Versions: 5.4.0.CR1
            Reporter: Cedric Hurst
            Assignee: Geoffrey De Smet
             Fix For: 5.4.0.Final


The scoreCorruptionAnalysis report returns the size of the excessSet when it should be returning the size of the lackingSet:

{code}
if (!lackingSet.isEmpty()) {
    analysis.append("  The workingMemory has ").append(excessSet.size()) // this should be lackingSet.size()
            .append(" ConstraintOccurrence(s) lacking:\n");
    int count = 0;
    for (Object o : lackingSet) {
        if (count >= CONSTRAINT_OCCURRENCE_DISPLAY_LIMIT) {
            analysis.append("    ... ").append(lackingSet.size() - CONSTRAINT_OCCURRENCE_DISPLAY_LIMIT)
                    .append(" more\n");
            break;
        }
        analysis.append("    ").append(o.toString()).append("\n");
        count++;
    }
}
{code}

Patch forthcoming.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list