Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-7925

Coverity: Logically dead code in PermissionMapperDefinitions (Elytron subsystem)

XMLWordPrintable

      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

      permissionMappings.add(new Mapping(principals != null ? principals : Collections.emptySet(),
              roles != null ? roles : Collections.emptySet(), permissions));
      

      should rather be

      permissionMappings.add(new Mapping(principals, roles, permissions));
      

      because both principals and roles local variables are initialized (new HashSet...) before this piece of code.

              rhn-support-ivassile Ilia Vassilev
              josef.cacek@gmail.com Josef Cacek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: