SimpleEvaluationContext.forReadOnlyDataBinding() documents that it creates a SimpleEvaluationContext for read-only access to public properties; however, that is only partially true. Write access is in fact disabled for properties accessed via the registered DataBindingPropertyAccessor, but write access is not disabled for indexed structures when using the assignment operator, the increment operator, or the decrement operator.

In order to better align with the documented contract for forReadOnlyDataBinding(), we should make it possible to disable assignment (i.e., write access within a SpEL expression) in general in order to enforce read-only semantics for SpEL's SimpleEvaluationContext when created via the forReadOnlyDataBinding() factory method.

Comment From: sbrannen

Reopening to introduce SimpleEvaluationContext.Builder.withAssignmentDisabled().