tkobayas commented on PR #6584:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6584#issuecomment-3918720897

   Claude Code gives additional suggestions below. I think they can be easily 
fixed.
   
   ---
   ## HIGH: No update/modify propagation in `PhreakBiLinearJoinNode`
   
   `PhreakBiLinearJoinNode.doNode()` handles inserts and deletes but has no
   `doLeftUpdates`/`doRightUpdates` — unlike `PhreakJoinNode`. Although 
BiLinear joins are
   unconstrained (no constraints to re-evaluate), update propagation is still 
required to
   signal downstream terminal nodes so rules re-activate on the agenda.
   
   **Impact:** After `session.update(fh, a); session.fireAllRules();`, the rule 
silently
   fails to re-fire.
   
   **Fix** is straightforward (no constraint re-evaluation needed) — just walk 
existing
   children and propagate the update:
   
   ```java
   for (TupleImpl leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple != 
null; ) {
       TupleImpl next = leftTuple.getStagedNext();
       for (TupleImpl child = leftTuple.getFirstChild(); child != null;
            child = child.getHandleNext()) {
           child.setPropagationContext(leftTuple.getPropagationContext());
           updateChildLeftTuple(child, stagedLeftTuples, trgLeftTuples);
       }
       leftTuple.clearStaged();
       leftTuple = next;
   }
   ```
   
   **Tests are vacuous:** `testBiLinearLeftUpdate`/`testBiLinearRightUpdate` 
assert
   `firedSecond >= 0` — this only checks no exception is thrown, not that the 
rule
   actually re-fires.
   
   ## HIGH: Debug `System.out.println` left in production code
   
   In `SegmentMemory.java`, the `addPathMemory()` method contains:
   
   ```java
   if (pathMemories.contains(pathMemory)) {
       System.out.println("!!!");
   }
   ```
   
   ## MEDIUM: Star imports violate project code style
   
   `GroupElementBuilder.java` and `ReteooRuleBuilder.java` use
   `import org.drools.core.reteoo.*;`, violating the project's explicit 
checkstyle rule:
   "No star imports". Will fail the build's checkstyle validation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to