apache / incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
http://www.drools.org
Apache License 2.0
5.88k stars 2.5k forks source link

Possible Casting Error? #6031

Closed songyahui closed 3 months ago

songyahui commented 3 months ago

Hi,

May I ask if there is a possible casting error here at line 251, which happens when command instanceof BatchExecutionCommand = true ? If that would be an casting error, is the try-catch construct (line 244-line 262) around it meant to handle such errors?

https://github.com/apache/incubator-kie-drools/blob/b00ef1d816c03dd3ff450d507c1ba70008629073/drools-kiesession/src/main/java/org/drools/kiesession/session/StatelessKnowledgeSessionImpl.java#L245-L251

Best, Yahui

mariofusco commented 3 months ago

Why are you asking? Can you reproduce any CCE? In reality all ours Command are also ExecutableCommand (and yes, we could probably unify those 2 interfaces into a single one) so this should never happen. That said feel free to reopen this issue in case you can reproduce the CCE.