throw new IllegalStateException("Could not obtain AclImpl.ace field", ex);
throw new IllegalStateException("Could not obtain AclImpl.ace field: cause[" + ex.getMessage() + "]");
    private void convertCurrentResultIntoObject(Map acls, ResultSet rs)        throws SQLException {        Long id = new Long(rs.getLong("ACL_ID"));        // If we already have an ACL for this ID, just create the ACE        AclImpl acl = (AclImpl) acls.get(id);        if (acl == null) {            // Make an AclImpl and pop it into the Map            ObjectIdentity objectIdentity = new ObjectIdentityImpl(rs.getString("CLASS"),                    new Long(rs.getLong("OBJECT_ID_IDENTITY")));            Acl parentAcl = null;            long parentAclId = rs.getLong("PARENT_OBJECT");            if (parentAclId != 0) {                parentAcl = new StubAclParent(new Long(parentAclId));            }            boolean entriesInheriting = rs.getBoolean("ENTRIES_INHERITING");            Sid owner;            if (rs.getBoolean("ACL_PRINCIPAL")) {                owner = new PrincipalSid(rs.getString("ACL_SID"));            } else {                owner = new GrantedAuthoritySid(rs.getString("ACL_SID"));            }            acl = new AclImpl(objectIdentity, id, parentAcl, auths, null, entriesInheriting, owner);            acls.put(id, acl);        }        // Add an extra ACE to the ACL (ORDER BY maintains the ACE list order)        Long aceId = new Long(rs.getLong("ACE_ID"));        Sid recipient;        if (rs.getBoolean("ACE_PRINCIPAL")) {            recipient = new PrincipalSid(rs.getString("ACE_SID"));        } else {            recipient = new GrantedAuthoritySid(rs.getString("ACE_SID"));        }        Permission permission = BasePermission.buildFromMask(rs.getInt("MASK"));        boolean granting = rs.getBoolean("GRANTING");        boolean auditSuccess = rs.getBoolean("AUDIT_SUCCESS");        boolean auditFailure = rs.getBoolean("AUDIT_FAILURE");        AccessControlEntryImpl ace = new AccessControlEntryImpl(aceId, acl, recipient, permission, granting,                auditSuccess, auditFailure);        Field acesField = getAccessibleField(AclImpl.class, "aces");        List aces;        try {            aces = (List) acesField.get(acl);        } catch (IllegalAccessException ex) {            throw new IllegalStateException("Could not obtain AclImpl.ace field", ex);        }        // Add the ACE if it doesn't already exist in the ACL.aces field        if (!aces.contains(ace)) {            aces.add(ace);        }    }