-
Bug
-
Resolution: Done
-
Major
-
None
-
7.50.0.Final
-
None
-
Undefined
-
NEW
-
NEW
-
---
-
---
If you use a fact class named "D", you will hit errors during executable-model code generation.
@Test public void testClassNameConflict() { String str = "import " + D.class.getCanonicalName() + ";" + "rule R when\n" + " D(name == \"John\")\n" + "then\n" + "end"; KieSession ksession = getKieSession( str ); D fact = new D("John"); ksession.insert( fact ); assertEquals(1, ksession.fireAllRules()); } public static class D { private String name; public D(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ERROR] CompilerTest.testClassNameConflict:2573->BaseModelTest.getKieSession:111->BaseModelTest.getKieSession:115->BaseModelTest.getKieContainer:119->BaseModelTest.getKieContainer:126->BaseModelTest.createKieBuilder:137->BaseModelTest.createKieBuilder:164 [Message [id=1, level=ERROR, path=src/main/java/defaultpkg/RulesF625E96E2F948CA04652DBAC4C6DBB79.java, line=5, column=1 text=a type with the same simple name is already defined by the single-type-import of org.drools.modelcompiler.dsl.pattern.D], Message [id=2, level=ERROR, path=src/main/java/defaultpkg/RulesF625E96E2F948CA04652DBAC4C6DBB79.java, line=0, column=0 text=Java source of src/main/java/defaultpkg/RulesF625E96E2F948CA04652DBAC4C6DBB79.java in error: package defaultpkg; import org.drools.modelcompiler.dsl.pattern.D; import org.drools.model.Index.ConstraintType; import org.drools.modelcompiler.CompilerTest.D; ...
- is related to
-
DROOLS-5819 executable-model test failure in test-compiler-integration PolymorphismTest
- Closed
-
DROOLS-6020 Separate drools-model-compiler generator from interpreter
- Open