Skip to content

vol2: post-#6718 minor cleanup — filter duplication, right-side multi-filter, remove() bug #6721

@mdproctor

Description

@mdproctor

Three minor items found during code review of #6718 (RuleBody descriptor redesign). None affect correctness for current tests.

1. Code duplication: subscribeWithFilter / subscribeWithFilters

BruteForceCompiledEngine and ReteEngine each have their own copy of subscribeWithFilter() and subscribeWithFilters(). Extract to a shared package-private utility (BetaProcessorWiring or similar).

2. Right-side multi-filter asymmetry in 2-pattern path

BruteForceCompiledEngine.wireHead() 2-pattern path uses findAlphaFilterPredicate() (returns only the first alpha constraint) for the right-side inlet. If a Pattern has multiple arity-1 LambdaConstraints, only the first applies to the right inlet. Left side uses subscribeWithFilters() (applies all). Fix to use subscribeWithFilters() consistently for both sides.

3. Pre-existing: RuleUnitChangeSet.remove() calls removed.remove(rule) instead of removed.add(rule)

RuleBaseModifier.java line ~157: removed.remove(rule) should be removed.add(rule) for the remove-tracking Set to work correctly. Pre-existing before #6718 but noted during review.

Refs #6718

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions