Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3627

NPE using a null literal in the left part of a constraint

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Trying to use a constraint with a null literal on its left side like in:

      Person( null == name )

      generates the following exception:

      java.lang.NullPointerException
      at java.lang.String.<init>(String.java:177)
      at org.mvel2.util.ErrorUtil.rewriteIfNeeded(ErrorUtil.java:12)
      at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:302)
      at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
      at org.mvel2.MVEL.compileExpression(MVEL.java:810)
      at org.drools.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:442)
      at org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:238)
      at org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:173)
      at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:157)
      at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:124)
      at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
      at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
      at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
      at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
      at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
      at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
      at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
      at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
      at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
      at org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:303)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                mfusco Mario Fusco
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: