Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: indented keywords would fail template expansion. #170

Merged
merged 2 commits into from
Jan 14, 2013
Merged

Fix: indented keywords would fail template expansion. #170

merged 2 commits into from
Jan 14, 2013

Conversation

magnusvojbacke
Copy link
Contributor

Issue description

In template files, whitespaces before keywords would cause exceptions.

I don't have a JIRA issue for this, but here's a link to a discussion about this issue on the Drools user mailing list:

http://drools.46999.n3.nabble.com/Why-are-indented-keywords-in-template-causing-NPE-or-DecisionTableParseException-tp4021193.html (TL;DR - "Response: Patch welcome")

Example of indented "template" keyword

template header age type log

Gives the exception:
org.drools.template.parser.DecisionTableParseException: Missing header
at org.drools.template.parser.DefaultTemplateContainer.parseTemplate(DefaultTemplateContainer.java:87)

Example of indented "rule" keyword

rule "Cheese fans_@{row.rowNumber}" when Person(age == @{age})

Gives the exception:
java.lang.NullPointerException
at org.drools.template.parser.DefaultTemplateColumn.createCellCondition(DefaultTemplateColumn.java:67)

Patch description

  • Altered the DefaultTemplateContainer.java to trim lines before comparison.
  • Added simple unit-tests to expose bug / confirm patch

@ghost ghost assigned manstis Jan 14, 2013
manstis added a commit that referenced this pull request Jan 14, 2013
Fix: indented keywords would fail template expansion. Thanks for the pull request.
@manstis manstis merged commit 1d1fde3 into apache:5.5.x Jan 14, 2013
Rikkola pushed a commit to Rikkola/drools that referenced this pull request Jan 27, 2020
lucamolteni pushed a commit to lucamolteni/drools that referenced this pull request Oct 13, 2021
dupliaka pushed a commit to dupliaka/drools that referenced this pull request Apr 1, 2022
apache#170)

* KOGITO-1120 - Create simple 'greeting' example (kogito + serverless workflow)

* fixed typo

* Updated examples to latest serverless runtime

* updated example to also add switch state

* fixing spanish spelling

* Renamed according to latest master changes
cimbalek pushed a commit to cimbalek/incubator-kie-drools that referenced this pull request Jan 19, 2024
* KOGITO-5171 Update failure message link

* update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants