Bug 967901 - NPE when compiling decision table with conditions starting with "#" or "//"
NPE when compiling decision table with conditions starting with "#" or "//"
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity unspecified
: ER2
: 6.0.0
Assigned To: Mario Fusco
Petr Široký
: Regression, TestBlocker
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-28 10:11 EDT by Petr Široký
Modified: 2014-08-06 16:17 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:17:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Maven based reproducer (12.25 KB, application/zip)
2013-05-28 10:12 EDT, Petr Široký
no flags Details

  None (edit)
Description Petr Široký 2013-05-28 10:11:39 EDT
Description of problem:
When trying to build decision table that contains comment character (# or //) at start of the cell with condition. e.g. the resulting condition is "Person (#age == 18)", the cell contains "#age (or //age)". This is not permitted, but the compiler should not throw NPE and instead generate some meaningful error message.


Version-Release number of selected component (if applicable):
6.0.0-SNAPSHOT (2013-05-28)


How reproducible:
Always


Steps to Reproduce:
1. Run the attached Maven reproducer (mvn test)


Actual results:
NPE throwed by compiler.


Expected results:
Meaningful error generated by compiler.


Additional info:
Comment 2 Petr Široký 2013-05-28 10:12:45 EDT
Created attachment 753930 [details]
Maven based reproducer
Comment 4 Petr Široký 2013-05-28 12:22:10 EDT
Forgot to add stacktrace, here it is:

java.lang.NullPointerException
	at org.drools.compiler.kie.builder.impl.MessageImpl.<init>(MessageImpl.java:49)
	at org.drools.compiler.kie.builder.impl.ResultsImpl.addMessage(ResultsImpl.java:39)
	at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:144)
	at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:39)
	at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieModule(KieBuilderImpl.java:207)
	at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:160)
	at org.kie.internal.utils.KieHelper.build(KieHelper.java:25)
Comment 7 Petr Široký 2013-08-31 13:44:01 EDT
Verified fixed in ER2. Error message is generated instead of NPE:

Note You need to log in before you can comment on or make changes to this bug.