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

   **Summary:** When a pattern has no identifier, the exec model auto-generates 
one; to do so, `ClassPatternDSL.findFirstInnerBinding` parses **every** 
constraint with `DrlxParseUtil.parseExpression` — a stricter parser than the 
`ConstraintParser.drlxParse` used for actual constraint compilation. If that 
strict parse throws, the `ParseProblemException` propagates and aborts the 
whole KieBase build from the naming pre-pass, masking the real compilation and 
yielding a confusing error.
   
   **Reproducer** (`Child extends Person`; constraint uses the subtype-match 
idiom `class == X.class`):
   ```drl
   import org.test.Person;
   import org.test.Child;
   rule R when
     Person( class == Child.class )
   then end
   ```
   - **Actual:** `ParseProblemException: Encountered unexpected token … at line 
1, column 1`, thrown from `findFirstInnerBinding` → aborts the build.
   
   **Root cause:** `findFirstInnerBinding` does not guard the `parseExpression` 
call. A constraint the strict parser can't parse cannot contribute an inner 
binding for naming anyway, so it should not abort the build.
   
   **Suggested fix:** catch the parse failure, log it (rule + pattern type + 
offending expression), and skip it — letting the real compilation path 
(`findAllConstraint` → `drlxParse`) either compile the constraint or report a 
proper error.


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