From dee09fde2262a5f528a98242b5f202f854f6e82a Mon Sep 17 00:00:00 2001 From: Mario Fusco Date: Fri, 3 Jan 2025 11:06:22 +0100 Subject: [PATCH] [KIE-DROOLS-6190] avoid reattaching a peer of a removed node during incremental compilation (#6210) --- .../main/java/org/drools/core/phreak/EagerPhreakBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java b/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java index 15478b1a2b7..62b6682fe35 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java +++ b/drools-core/src/main/java/org/drools/core/phreak/EagerPhreakBuilder.java @@ -1361,7 +1361,7 @@ static void deleteLeftTuple(TupleImpl removingLt, TupleImpl removingLt2, TupleIm } else { // is the LT for the LIAN, if so we need to process the FH too fh.removeLeftTuple(removingLt); - if (leftPrevious == null) { + if (leftPrevious == null && nextPeerLt.getSink().getAssociatedTerminalsSize() > 0) { // The removed tuple was first in linked list, add the peer at its original position fh.addFirstLeftTuple( nextPeerLt ); }