Bug 967901 - NPE when compiling decision table with conditions starting with "#" or "//"
Summary: NPE when compiling decision table with conditions starting with "#" or "//"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER2
: 6.0.0
Assignee: Mario Fusco
QA Contact: Petr Široký
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-28 14:11 UTC by Petr Široký
Modified: 2014-08-06 20:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:17:14 UTC
Type: Bug
Embargoed:


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

Description Petr Široký 2013-05-28 14:11:39 UTC
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 14:12:45 UTC
Created attachment 753930 [details]
Maven based reproducer

Comment 4 Petr Široký 2013-05-28 16:22:10 UTC
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 17:44:01 UTC
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.