omarmahamid opened a new issue, #6411:
URL: https://github.com/apache/incubator-kie-drools/issues/6411

   When using Map() explicitly in a Drools rule, a TypeDeclaration merge 
conflict can occur during knowledge base merging, specifically related to the 
@propertyReactive attribute.
   
   Steps to Reproduce
   
   Define a rule using:
   
   1. 
   ```drl
   $someMap : Map() ...
   ```
   
   2. Compile and build a knowledge base containing this rule. The first build 
may succeed.
   
   3. Merge this knowledge base with another that also refers to Map() 
explicitly.
   
   4. Observe the following error:
   
   ```java
   Unable to merge @propertyReactive attribute for type declaration of class Map
   ````
   
   ## Root Cause
   
   It appears that Drools applies post-processing to most java.util.* types and 
sets propertyReactive = true. However, Map and Collection are treated as 
special cases and initialized internally without post-processing 
(https://github.com/apache/incubator-kie-drools/blob/main/drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationCache.java#L64),
 leading to:
   
   * One TypeDeclaration of Map with propertyReactive = true (from 
post-processing in the initial build).
   
   * Another TypeDeclaration of Map with propertyReactive = false (from 
internal initialization).
   
   This inconsistency causes a merge conflict.
   
   ## Expected Behavior
   
   Drools should handle Map consistently across builds and merges, either by 
ensuring post-processing is applied uniformly or by explicitly setting 
propertyReactive during internal initialization.
   
   


-- 
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