[jboss-jira] [JBoss JIRA] (DROOLS-1337) A FQN inline cast followed by a method invocation causes an ArrayIndexOutOfBoundsException
Matteo Mortari (JIRA)
issues at jboss.org
Thu Oct 20 09:33:00 EDT 2016
[ https://issues.jboss.org/browse/DROOLS-1337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matteo Mortari reassigned DROOLS-1337:
--------------------------------------
Assignee: Matteo Mortari (was: Mario Fusco)
> A FQN inline cast followed by a method invocation causes an ArrayIndexOutOfBoundsException
> ------------------------------------------------------------------------------------------
>
> Key: DROOLS-1337
> URL: https://issues.jboss.org/browse/DROOLS-1337
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Reporter: Mario Fusco
> Assignee: Matteo Mortari
>
> An inline cast using a fully qualified name followed by a method invocation causes an ArrayIndexOutOfBoundsException as in the following test case:
> {code}
> @Test
> public void testInlineCastWithFQNAndMethodInvocation() throws Exception {
> String str =
> "import org.drools.compiler.Person;\n" +
> "global java.util.List list;\n" +
> "rule R1 when\n" +
> " Person( name == \"mark\", $x : address#org.drools.compiler.LongAddress.country.substring(1) )\n" +
> "then\n" +
> " list.add($x);" +
> "end\n";
> KnowledgeBase kbase = loadKnowledgeBaseFromString(str);
> StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
> List<String> list = new ArrayList<String>();
> ksession.setGlobal( "list", list );
> Person mark1 = new Person("mark");
> mark1.setAddress(new LongAddress("uk"));
> ksession.insert(mark1);
> assertEquals(1, ksession.fireAllRules());
> assertEquals(1, list.size());
> assertEquals("k", list.get(0));
> ksession.dispose();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list