public boolean isReadOnly(ELContext context, Object base, Object property) {

        if ((base == null) || (property == null)) {
            return false;
        }

        context.setPropertyResolved(true);
        FacesContext fcontext = (FacesContext) context.getContext(FacesContext.class);
        ELContext elContext = fcontext.getELContext();
        PropertyResolver pr = fcontext.getApplication().getPropertyResolver();

        if ((base instanceof List) || base.getClass().isArray()) {
            Integer index = (Integer) fcontext.getApplication().getExpressionFactory().
                    coerceToType(property, Integer.class);
            try {
                return pr.isReadOnly(base, index.intValue());
            } catch (EvaluationException e) {
                context.setPropertyResolved(false);
                throw new ELException(e);
            }
        } else {
            try {
                return pr.isReadOnly(base, property);
            } catch (EvaluationException e) {
                context.setPropertyResolved(false);
                throw new ELException(e);
            }
        }

    }