Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Make TypeAdaptor method adaptation thread safe (#5621)
When checking whether a method overrides another, we need to adapt both methods to a common ground. In an early version this required cloning the entire method, including its body, to perform the adaption. PR #4862 fixed this by nulling the body before cloning the method and then restoring it afterwards. This operation is not thread safe, as it may write concurrently and also modifies what other parallel threads might see when traversing the model. This patch now introduces a private override specifying whether we are only interested in the signature. If that is the case, we explicitly construct a new method using the factory instead of cloning the original. Closes: #5619 Co-authored-by: I-Al-Istannen <[email protected]>
- Loading branch information