Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-7830

Coverity: Logically dead code in PermissionMapperDefinitions (Elytron subsystem)

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: