Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-2495

NullPointerException in Declaration.getHashCode() when getter in LHS and serialize/deserialize package

    Details

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

      Description

      Under the condition:

      • A rule uses a getter method in LHS. e.g. "Cheese(type == $p.getName())"
      • A package is serialized/deserialized

      executing the rule throws NullPointerException.

      java.lang.NullPointerException: null
      	at org.drools.core.rule.Declaration.getHashCode(Declaration.java:267)
      	at org.drools.core.util.AbstractHashTable$FieldIndex.hashCodeOf(AbstractHashTable.java:333)
      	at org.drools.core.util.AbstractHashTable$SingleIndex.hashCodeOf(AbstractHashTable.java:397)
      	at org.drools.core.util.index.TupleIndexHashTable.getOrCreate(TupleIndexHashTable.java:392)
      	at org.drools.core.util.index.TupleIndexHashTable.add(TupleIndexHashTable.java:358)
      	at org.drools.core.phreak.PhreakJoinNode.doLeftInserts(PhreakJoinNode.java:95)
      	at org.drools.core.phreak.PhreakJoinNode.doNode(PhreakJoinNode.java:71)
      	at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:552)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:538)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:373)
      	at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:333)
      	at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:169)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:127)
      	at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:212)
      	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:87)
      	at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34)
      	at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
      	at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1067)
      	at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1014)
      	at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1006)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1315)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1306)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1290)
      	at org.drools.compiler.integrationtests.SerializedPackageMergeTest.testBuildAndSerializePackagesWithGetterInLHS(SerializedPackageMergeTest.java:220)
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  tkobayashi Toshiya Kobayashi
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: