Sam Brannen e1ab306506 Enforce read-only semantics in SpEL's SimpleEvaluationContext
SimpleEvaluationContext.forReadOnlyDataBinding() documents that it
creates a SimpleEvaluationContext for read-only access to public
properties; however, prior to this commit write access was 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(), this commit makes it possible to disable
assignment in general in order to enforce read-only semantics for
SpEL's SimpleEvaluationContext when created via the
forReadOnlyDataBinding() factory method. Specifically:

- This commit introduces a new isAssignmentEnabled() "default" method
  in the EvaluationContext API, which returns true by default.

- SimpleEvaluationContext overrides isAssignmentEnabled(), returning
  false if the context was created via the forReadOnlyDataBinding()
  factory method.

- The Assign, OpDec, and OpInc AST nodes -- representing the assignment
  (=), increment (++), and decrement (--) operators, respectively --
  now throw a SpelEvaluationException if assignment is disabled for the
  current EvaluationContext.

See gh-33319
Closes gh-33321

(cherry picked from commit 0127de5a7a)
2024-08-06 14:12:03 +03:00
2024-07-10 15:45:02 +02:00
2024-07-14 11:13:35 +02:00
2024-05-23 17:12:22 +02:00
2024-07-10 15:45:02 +02:00
2024-07-10 15:45:02 +02:00
2024-07-10 15:45:02 +02:00
2024-05-14 13:03:35 +02:00
2024-05-14 13:03:35 +02:00
2024-05-14 13:03:35 +02:00
2024-05-21 11:42:30 +02:00
2024-02-16 22:41:50 +01:00
2024-05-14 13:03:35 +02:00
2017-06-12 08:07:54 +02:00
2024-05-22 10:20:33 +02:00
2024-04-22 12:12:11 +02:00
2019-03-21 15:08:55 -05:00
2022-11-02 10:59:12 +01:00
2024-07-14 11:13:35 +02:00
2024-07-14 11:13:35 +02:00
2019-08-20 22:01:12 +02:00
2024-03-15 09:14:22 +01:00
2024-04-30 19:09:44 +02:00

Spring Framework Build Status Revved up by Develocity

This is the home of the Spring Framework: the foundation for all Spring projects. Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".

Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the Overview section as reference for a more complete introduction.

Code of Conduct

This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.

Access to Binaries

For access to artifacts or a distribution zip, see the Spring Framework Artifacts wiki page.

Documentation

The Spring Framework maintains reference documentation (published and source), GitHub wiki pages, and an API reference. There are also guides and tutorials across Spring projects.

Micro-Benchmarks

See the Micro-Benchmarks wiki page.

Build from Source

See the Build from Source wiki page and the CONTRIBUTING.md file.

Continuous Integration Builds

Information regarding CI builds can be found in the Spring Framework Concourse pipeline documentation.

Stay in Touch

Follow @SpringCentral, @SpringFramework, and its team members on Twitter. In-depth articles can be found at The Spring Blog, and releases are announced via our news feed.

License

The Spring Framework is released under version 2.0 of the Apache License.

Description
No description provided
Readme 248 MiB
Languages
Java 99.4%
XSLT 0.2%
AspectJ 0.2%