if (acls[i] instanceof AbstractBasicAclEntry) { AbstractBasicAclEntry processableAcl = (AbstractBasicAclEntry) acls[i];
if (acls[i] instanceof BasicAclEntry) { BasicAclEntry processableAcl = (BasicAclEntry) acls[i];
    public Object decide(Authentication authentication, Object object,        ConfigAttributeDefinition config, Object returnedObject)        throws AccessDeniedException {        Iterator iter = config.getConfigAttributes();        while (iter.hasNext()) {            ConfigAttribute attr = (ConfigAttribute) iter.next();            if (this.supports(attr)) {                // Need to make an access decision on this invocation                if (returnedObject == null) {                    // AclManager interface contract prohibits nulls                    // As they have permission to null/nothing, grant access                    if (logger.isDebugEnabled()) {                        logger.debug("Return object is null, skipping");                    }                    return null;                }                AclEntry[] acls = aclManager.getAcls(returnedObject,                        authentication);                if ((acls == null) || (acls.length == 0)) {                    throw new AccessDeniedException("Authentication: "                        + authentication.toString()                        + " has NO permissions at all to the domain object: "                        + returnedObject);                }                for (int i = 0; i < acls.length; i++) {                    // Locate processable AclEntrys                    if (acls[i] instanceof AbstractBasicAclEntry) {                        AbstractBasicAclEntry processableAcl = (AbstractBasicAclEntry) acls[i];                        // See if principal has any of the required permissions                        for (int y = 0; y < requirePermission.length; y++) {                            if (processableAcl.isPermitted(requirePermission[y])) {                                if (logger.isDebugEnabled()) {                                    logger.debug(                                        "Principal DOES have permission to return object: "                                        + returnedObject + " due to ACL: "                                        + processableAcl.toString());                                }                                return returnedObject;                            }                        }                    }                }                // No permissions match                throw new AccessDeniedException("Authentication: "                    + authentication.toString()                    + " has ACL permissions to the domain object, but not the required ACL permission to the domain object: "                    + returnedObject);            }        }        return returnedObject;    }