]
Mark Proctor updated JBRULES-3057:
----------------------------------
Assignee: Edson Tirelli (was: Mark Proctor)
Misleading error message for missing constructor
------------------------------------------------
Key: JBRULES-3057
URL:
https://issues.jboss.org/browse/JBRULES-3057
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Edson Tirelli
Fix For: 5.3.0.Final
If an undeclared constructor is called in a consequence, a very strange error message is
produced:
- error text is "Failed to compileShared" ("Shared" is not used by
the app)
- The message part meant ot identify the location of the error is misleanding, e.g.,
Near : {... p3.setName( "Paul" ); ....}
with the marker ("^") pointing to "Paul".
public static class Person {
private String name;
public Person(String name){
this.name = name;
}
public String getField1() {
return field1;
}
public void setName( String name ) {
this.name = name;
}
public String getName() {
return name;
}
}
@Test
public void testExistsIterativeModifyBug() {
String str = "";
str += "package org.simple ";
str += "import Person ";
str += "rule xxx ";
str += "when ";
str += "then ";
str += " Person = new Person() ";
str += "end ";
KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
assertFalse( kBuilder.hasErrors() );
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.fireAllRules();
ksession.dispose();
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: