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

Ilia Vassilev (JIRA) issues at jboss.org
Wed Dec 21 10:47:00 EST 2016


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

Ilia Vassilev moved ELY-843 to WFLY-7830:
-----------------------------------------

    Project: WildFly  (was: WildFly Elytron)
        Key: WFLY-7830  (was: ELY-843)


> Coverity: Logically dead code in PermissionMapperDefinitions (Elytron subsystem)
> --------------------------------------------------------------------------------
>
>                 Key: WFLY-7830
>                 URL: https://issues.jboss.org/browse/WFLY-7830
>             Project: WildFly
>          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