[jboss-jira] [JBoss JIRA] (DROOLS-524) Collections are type-unsafe by default and may lead to runtime errors

Mark Proctor (JIRA) issues at jboss.org
Thu Jul 23 13:03:05 EDT 2015


     [ https://issues.jboss.org/browse/DROOLS-524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor reassigned DROOLS-524:
-----------------------------------

    Assignee: Mario Fusco  (was: Mark Proctor)


> Collections are type-unsafe by default and may lead to runtime errors
> ---------------------------------------------------------------------
>
>                 Key: DROOLS-524
>                 URL: https://issues.jboss.org/browse/DROOLS-524
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 5.5.0.Final, 5.6.0.Final, 6.0.0.Final, 6.0.1.Final, 6.1.0.CR1, 6.1.0.Final
>            Reporter: Davide Sottara
>            Assignee: Mario Fusco
>            Priority: Minor
>
> Collections are type-unsafe, so it is possible to write constraints on non-existing fields. The compiler will not report any error, but an exception will be thrown at runtime. 
> The configuration was needed to support map and list accessors:
> {code}
> Map( this[ "key" ].someFieldOfTheValue > 0 )
> {code}
> but an explicit cast would be preferable
> {code}
> Map( this[ "key" ]#ClassOfTheValue.someFieldOfTheValue > 0 )
> {code}
> This bug can't be fixed in 6.x due to backward compatibility. It will be fixed in future major versions.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list