CPD Results

The following document contains the results of PMD's CPD 5.3.5.

Duplications

File Line
net\sf\michaelo\tomcat\realm\ActiveDirectoryRealm.java 314
net\sf\michaelo\tomcat\realm\CombinedActiveDirectoryRealm.java 178
		}

		return principal;
	}

	@Override
	public boolean hasRole(Principal principal, String role) {

		if (principal == null || role == null || !(principal instanceof ActiveDirectoryPrincipal))
			return false;

		ActiveDirectoryPrincipal adp = (ActiveDirectoryPrincipal) principal;

		boolean result;
		if (container instanceof Context) {
			Context context = (Context) container;
			result = adp.hasRole(context.findRoleMapping(role));
		} else
			result = adp.hasRole(role);

		if (logger.isDebugEnabled()) {
			if (result)
				logger.debug(sm.getString("activeDirectoryRealm.hasRole", principal, role));
			else
				logger.debug(sm.getString("activeDirectoryRealm.hasNotRole", principal, role));
		}

		return result;
	}