<p>Anybody care if I merge this pull request? I was involved with the original emails on drools-user.</p>
<p>It'd be a shame to let (new?) community involvement slip by.</p>
<p>sent on the move</p>
<p>---------- Forwarded message ----------<br>From: "magnusvojbacke" <<a href="mailto:notifications@github.com">notifications@github.com</a>><br>Date: 22 Dec 2012 15:39<br>Subject: [drools] Fixing issue where indented keywords would fail template expansion. (#170)<br>
To: "droolsjbpm/drools" <<a href="mailto:drools@noreply.github.com">drools@noreply.github.com</a>><br><br type="attribution"><h1>Issue description</h1>
<p>In template files, whitespaces before keywords would cause exceptions.</p>
<h2>Example of indented "template" keyword</h2>
<p><code>template header<br>
age<br>
type<br>
log</code></p>
<p>Gives the exception:<br>
org.drools.template.parser.DecisionTableParseException: Missing header <br>
at org.drools.template.parser.DefaultTemplateContainer.parseTemplate(DefaultTemplateContainer.java:87)</p>
<h2>Example of indented "rule" keyword</h2>
<p><code>rule "Cheese fans_@{row.rowNumber}"<br>
when<br>
Person(age == @{age})</code></p>
<p>Gives the exception:<br>
java.lang.NullPointerException<br>
at org.drools.template.parser.DefaultTemplateColumn.createCellCondition(DefaultTemplateColumn.java:67)</p>
<h1>Patch description</h1>
<ul>
<li>Altered the DefaultTemplateContainer.java to trim lines before comparison.</li>
<li>Added simple unit-test to expose bug / confirm patch</li>
</ul>
<hr>
<h4>You can merge this Pull Request by running:</h4>
<pre> git pull <a href="https://github.com/magnusvojbacke/drools" target="_blank">https://github.com/magnusvojbacke/drools</a> templates_indented_keywords</pre>
<p>Or view, comment on, or merge it at:</p>
<p> <a href="https://github.com/droolsjbpm/drools/pull/170" target="_blank">https://github.com/droolsjbpm/drools/pull/170</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Fixing issue where indented keywords would fail template expansion.</li>
</ul>
<h4>File Changes</h4>
<ul>
<li><strong>M</strong> drools-templates/src/main/java/org/drools/template/parser/DefaultTemplateContainer.java (17)</li>
<li><strong>M</strong> drools-templates/src/test/java/org/drools/template/parser/DefaultTemplateContainerTest.java (11)</li>
<li><strong>A</strong> drools-templates/src/test/resources/templates/rule_template_indented.drl (35)</li>
</ul>
<h4>Patch Links</h4>
<ul>
<li><a href="https://github.com/droolsjbpm/drools/pull/170.patch" target="_blank">https://github.com/droolsjbpm/drools/pull/170.patch</a></li>
<li><a href="https://github.com/droolsjbpm/drools/pull/170.diff" target="_blank">https://github.com/droolsjbpm/drools/pull/170.diff</a></li>
</ul>
<p style="font-size:small;color:#666">
—<br>
Reply to this email directly or <a href="https://github.com/droolsjbpm/drools/pull/170" target="_blank">view it on GitHub</a>.
</p>
<img src="https://github.com/notifications/beacon/YP33oeuhfQ_NWCxYdfpwbRvu_x89wu6mo5Rz6vcdFXeGPpI69R9c6MwJD6o6uVdA.gif" height="1" width="1">
</p>