[jboss-jira] [JBoss JIRA] Closed: (JBRULES-1814) org.drools.agent.RuleAgent list() can produce lists containing strings consisting of whitechars only

Mark Proctor (JIRA) jira-events at lists.jboss.org
Wed Jan 14 19:39:14 EST 2009


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

Mark Proctor closed JBRULES-1814.
---------------------------------

    Fix Version/s: 5.0.0.M5
       Resolution: Done


> org.drools.agent.RuleAgent list() can produce lists containing strings consisting of whitechars only
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-1814
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-1814
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions:  5.0.0.M2
>            Reporter: Cezary Dendek
>            Assignee: Mark Proctor
>             Fix For: 5.0.0.M5
>
>
> static List list(String property) contains following lines (2 occurences):
>         if ( current.trim() != "" ) {
>             items.add( current );
>         }
> as it is object references comparision (not string itself) it can fail (in fact it depends on implementation of trim(): if it is not optimised to return empty string explicitly - which should be cached by JVM - it will return new empty string causing the bug)
> It should be written eg. in this way:
>         if ( !"".equals(current.trim()) ) {
>             items.add( current );
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list