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

Davide Sottara (JIRA) issues at jboss.org
Thu Jun 12 09:06:38 EDT 2014


Davide Sottara created DROOLS-524:
-------------------------------------

             Summary: 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
      Security Level: Public (Everyone can see)
    Affects Versions: 6.1.0.CR1, 6.0.1.Final, 6.0.0.Final, 5.6.0.Final, 5.5.0.Final, 6.1.0.Final
            Reporter: Davide Sottara
            Assignee: Mark Proctor
            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.2.6#6264)


More information about the jboss-jira mailing list