[jboss-jira] [JBoss JIRA] (ELY-843) Coverity: Logically dead code in PermissionMapperDefinitions (Elytron subsystem)

Ilia Vassilev (JIRA) issues at jboss.org
Mon Dec 19 11:00:01 EST 2016


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

Ilia Vassilev reassigned ELY-843:
---------------------------------

    Assignee: Ilia Vassilev  (was: Darran Lofthouse)


> Coverity: Logically dead code in PermissionMapperDefinitions (Elytron subsystem)
> --------------------------------------------------------------------------------
>
>                 Key: ELY-843
>                 URL: https://issues.jboss.org/browse/ELY-843
>             Project: WildFly Elytron
>          Issue Type: Bug
>            Reporter: Josef Cacek
>            Assignee: Ilia Vassilev
>              Labels: static_analysis
>
> Coverity static-analysis scan found a logically dead code in the {{PermissionMapperDefinitions.getSimplePermissionMapper}} method.
> https://scan7.coverity.com/reports.htm#v16159/p12663/fileInstanceId=6892117&defectInstanceId=1794520&mergedDefectId=1388477
> https://scan7.coverity.com/reports.htm#v16159/p12663/fileInstanceId=6892117&defectInstanceId=1794521&mergedDefectId=1388478
> Following code
> {code:java}
> permissionMappings.add(new Mapping(principals != null ? principals : Collections.emptySet(),
>         roles != null ? roles : Collections.emptySet(), permissions));
> {code}
> should rather be
> {code:java}
> permissionMappings.add(new Mapping(principals, roles, permissions));
> {code}
> because both {{principals}} and {{roles}} local variables are initialized ({{new HashSet...}}) before this piece of code.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list