You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tkobayas (via GitHub)" <gi...@apache.org> on 2024/05/10 08:02:43 UTC
[PR] [incubator-kie-drools-5915] [new-parser] ctx.lhsPattern().size() == 0 [incubator-kie-drools]
tkobayas opened a new pull request, #5922:
URL: https://github.com/apache/incubator-kie-drools/pull/5922
- Avoid unnecessary IllegalStateException
- Avoid empty error message
**Issue**:
* https://github.com/apache/incubator-kie-drools/issues/5915
This PR actually fixes only `org.drools.compiler.integrationtests.drl.DRLTest#testWithInvalidRule2` in the failing tests in the GH issue . Other tests are explained in the comments of the GH issue and will be dealt by other PRs.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-drools-5915] [new-parser] ctx.lhsPattern().size() == 0 [incubator-kie-drools]
Posted by "mariofusco (via GitHub)" <gi...@apache.org>.
mariofusco merged PR #5922:
URL: https://github.com/apache/incubator-kie-drools/pull/5922
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-drools-5915] [new-parser] ctx.lhsPattern().size() == 0 [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5922:
URL: https://github.com/apache/incubator-kie-drools/pull/5922#discussion_r1596414191
##########
drools-drl/drools-drl-parser/src/main/java/org/drools/drl/parser/antlr4/DRLVisitorImpl.java:
##########
@@ -542,7 +542,7 @@ public BaseDescr visitLhsPatternBind(DRLParser.LhsPatternBindContext ctx) {
} else if (ctx.lhsPattern().size() > 1) {
return getOrDescrWithMultiplePatternDescr(ctx);
} else {
- throw new IllegalStateException("ctx.lhsPattern().size() == 0 : " + ctx.getText());
+ return null; // only caused by a parser error
Review Comment:
Users can read a parser error message, so no need of the explicit IllegalStateException.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-drools-5915] [new-parser] ctx.lhsPattern().size() == 0 [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on PR #5922:
URL: https://github.com/apache/incubator-kie-drools/pull/5922#issuecomment-2104205763
@yurloc @mariofusco @gitgabrio Please review, thanks!
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org