]
Ilia Vassilev updated WFLY-7830:
--------------------------------
Component/s: Security
Coverity: Logically dead code in PermissionMapperDefinitions (Elytron
subsystem)
--------------------------------------------------------------------------------
Key: WFLY-7830
URL:
https://issues.jboss.org/browse/WFLY-7830
Project: WildFly
Issue Type: Bug
Components: Security
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=68921...
https://scan7.coverity.com/reports.htm#v16159/p12663/fileInstanceId=68921...
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.