[jboss-jira] [JBoss JIRA] (JBRULES-3487) NullPointerException in org.jbpm.ruleflow.core.validation.RuleFlowProcessValidator

James Nord (JIRA) jira-events at lists.jboss.org
Wed May 2 07:19:18 EDT 2012


James Nord created JBRULES-3487:
-----------------------------------

             Summary: NullPointerException in org.jbpm.ruleflow.core.validation.RuleFlowProcessValidator
                 Key: JBRULES-3487
                 URL: https://issues.jboss.org/browse/JBRULES-3487
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core (flow)
    Affects Versions: 5.4.0.CR1
            Reporter: James Nord
            Assignee: Mark Proctor


There is a coding issue in that leads to a NullPOinterException.
The Exception has been shown presumable due to an invalid rf file - but the code gives an unhelpful exception.

Insepction of the code reveals that if the first condition is true on line 193 then the code will blow up - which is presumable not what the coder has intended

{code:title=RuleFlowProcessValidator.java Line 190 onwars|borderStyle=solid}
                if (split.getType() == Split.TYPE_XOR || split.getType() == Split.TYPE_OR ) {
                    for ( final Iterator<Connection> it = split.getDefaultOutgoingConnections().iterator(); it.hasNext(); ) {
                        final Connection connection = it.next();
                        if (split.getConstraint(connection) == null && !split.getConstraint(connection).isDefault() && (split.getConstraint(connection).getConstraint() == null || split.getConstraint(connection).getConstraint().trim().length() == 0)) {
                            errors.add(new ProcessValidationErrorImpl(process,
                                "Split node '" + node.getName() + "' [" + node.getId() + "] does not have a constraint for " + connection.toString() + "."));
                        }
                    }
                }
{code}

"if (split.getConstraint(connection) == null && !split.getConstraint(connection).isDefault()"

if "split.gerConstraint(connection)" is null then "split.getConstraint(connection).isDefault()" will dereference null.




--
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