backport for PR 3171 missing readOnlyClass methods