[rules-dev] Fwd: [drools] Fixing issue where indented keywords would fail template expansion. (#170)
Michael Anstis
michael.anstis at gmail.com
Fri Jan 11 15:42:56 EST 2013
Anybody care if I merge this pull request? I was involved with the original
emails on drools-user.
It'd be a shame to let (new?) community involvement slip by.
sent on the move
---------- Forwarded message ----------
From: "magnusvojbacke" <notifications at github.com>
Date: 22 Dec 2012 15:39
Subject: [drools] Fixing issue where indented keywords would fail template
expansion. (#170)
To: "droolsjbpm/drools" <drools at noreply.github.com>
Issue description
In template files, whitespaces before keywords would cause exceptions.
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-test to expose bug / confirm patch
------------------------------
You can merge this Pull Request by running:
git pull https://github.com/magnusvojbacke/drools templates_indented_keywords
Or view, comment on, or merge it at:
https://github.com/droolsjbpm/drools/pull/170
Commit Summary
- Fixing issue where indented keywords would fail template expansion.
File Changes
- *M*drools-templates/src/main/java/org/drools/template/parser/DefaultTemplateContainer.java
(17)
- *M*drools-templates/src/test/java/org/drools/template/parser/DefaultTemplateContainerTest.java
(11)
- *A*drools-templates/src/test/resources/templates/rule_template_indented.drl
(35)
Patch Links
- https://github.com/droolsjbpm/drools/pull/170.patch
- https://github.com/droolsjbpm/drools/pull/170.diff
—
Reply to this email directly or view it on
GitHub<https://github.com/droolsjbpm/drools/pull/170>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20130111/8d864137/attachment.html
More information about the rules-dev
mailing list