deliveredtechnologies / rulebook

100% Java, Lambda Enabled, Lightweight Rules Engine with a Simple and Intuitive DSL
http://www.deliveredtechnologies.com
Apache License 2.0
716 stars 124 forks source link

RuleAdapter support for unnamed facts of wildcarded collection types #173

Closed BrianDeacon closed 4 years ago

BrianDeacon commented 4 years ago

Unnamed @Given fields in a POJO rule that are a collection type try to collect any unnamed facts of compatible types and add them to the collection. But if the field is genericized to a wildcard type (like Set<? extends Number>), it was hitting a ClassCastException attempting to hard-cast the parameter to Class<?> rather than WildCardType or TypeVariable as appropriate. This will now identify eligible wildcard types for those wildcarded collections as well.

Clayton7510 commented 4 years ago

Thanks for the submission!