[jboss-jira] [JBoss JIRA] (DROOLS-588) Constraints with same expression causes a node sharing even if they shouldn't
Mario Fusco (JIRA)
issues at jboss.org
Wed Jul 8 06:54:02 EDT 2015
[ https://issues.jboss.org/browse/DROOLS-588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-588.
--------------------------------
Fix Version/s: 6.3.0.CR1
Resolution: Done
Fixed by https://github.com/droolsjbpm/drools/commit/22a8a6d1ca2c52cb6c7e186887426212a438ca0d
> Constraints with same expression causes a node sharing even if they shouldn't
> -----------------------------------------------------------------------------
>
> Key: DROOLS-588
> URL: https://issues.jboss.org/browse/DROOLS-588
> Project: Drools
> Issue Type: Bug
> Reporter: Mario Fusco
> Assignee: Mario Fusco
> Fix For: 6.3.0.CR1
>
>
> Reoroducer:
> {code}
> @Test
> public void testWrongNodeSharing() {
> String drl1 =
> "package test1\n" +
> "import static " + Misc2Test.class.getCanonicalName() + ".parseInt;\n" +
> "global java.util.List list;\n" +
> "rule R when\n" +
> " String( parseInt(this) == 0 )\n" +
> "then\n" +
> " list.add(\"OK\");\n" +
> "end";
> String drl2 =
> "package test2\n" +
> "import static java.lang.Integer.parseInt;\n" +
> "global java.util.List list;\n" +
> "rule R when\n" +
> " String( parseInt(this) == 0 )\n" +
> "then\n" +
> " list.add(\"NOT OK\");\n" +
> "end";
> KieHelper helper = new KieHelper();
> helper.addContent( drl1, ResourceType.DRL );
> helper.addContent( drl2, ResourceType.DRL );
> KieSession kieSession = helper.build().newKieSession();
> List list = new ArrayList();
> kieSession.setGlobal( "list", list );
> kieSession.insert( "3" );
> kieSession.fireAllRules();
> assertEquals( 1, list.size() );
> assertEquals( "OK", list.get(0) );
> }
> public static int parseInt(String s) {
> return 0;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-jira
mailing list