MethodMetaData m = (MethodMetaData) iterator.next(); if (m.patternMatches(methodName, params, iface)) { /* If this is an unchecked method anyone can access it so set the result set to a role that equates to any Principal or Principal name and return. */ if (m.isUnchecked()) { result.clear(); result.add(AnybodyPrincipal.ANYBODY_PRINCIPAL); break; } // Else, add all roles else { Iterator rolesIterator = m.getRoles().iterator(); while (rolesIterator.hasNext()) { String roleName = (String) rolesIterator.next(); result.add(new SimplePrincipal(roleName)); } } } } // If no permissions were assigned to the method return null to indicate no access if( result.isEmpty() ) { result = null; }