-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
NEW
-
NEW
In some cases nested properties get hashed by the CompositeObjectSinkAdapter even if they shouldn't
The following test case demonstrates this problem:
public class A1 { public B1 b = new B1(); } public class B1 { public int b1 = 1; public int b2 = 2; public int b3 = 3; } @Test public void testSkipHashingOfNestedProperties() { String drl = "import " + A1.class.getCanonicalName() + "\n" + "global java.util.List list\n" + "rule One when\n" + " A1(b.b1 == 1)\n" + "then\n" + " list.add(\"One\");\n" + "end\n" + "\n" + "rule \"Two\" when\n" + " A1(b.b2 == 2)\n" + "then\n" + " list.add(\"Two\");\n" + "end\n" + "\n" + "rule \"Three\" when\n" + " A1(b.b3 == 3)\n" + "then\n" + " list.add(\"Three\");\n" + "end\n"; KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); List<Object> list = new ArrayList<Object>(); ksession.setGlobal( "list", list ); ksession.insert( new A1() ); ksession.fireAllRules(); assertEquals( 3, list.size() ); }