Details
-
Bug
-
Resolution: Done
-
Major
-
6.2.0.Beta1
-
None
Description
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