David Fell created DROOLS-626:
---------------------------------
Summary: collectList on objects of type java.lang.Class get returned as null
Key: DROOLS-626
URL:
https://issues.jboss.org/browse/DROOLS-626
Project: Drools
Issue Type: Bug
Affects Versions: 6.2.0.Beta1
Environment: Snapshot Drools 6.2.0.201410031437 runtime
Reporter: David Fell
Assignee: Mark Proctor
If collectList in an accumulate is supplied objects of type java.lang.Class, then
subsequent examination of the supplied list yields null values rather than the expect
Class values.
Test case below. Swapping the comments to make InitClass have a String field instead of a
Class field changes the behaviour of the list from collectList to what one would expect.
package com.sample
declare MyClass end
declare InitClass
clazz: Class @key
// clazz: String @key
end
rule "init"
when
then
insert( new InitClass( MyClass.class ) );
// insert( new InitClass( "some string" ) );
end
rule "make init classes"
when
accumulate( InitClass( $clazz; ), $list: collectList( $clazz ) )
then
System.out.printf("%d items in list\n", $list.size());
for(Object obj : $list)
System.out.printf("item is %s\n", obj);
end
rule "show init classes"
when
InitClass( $v; )
then
System.out.printf("match %s\n", $v);
end
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)