From a01fb3b665f39d166bea058e684f36f708f46cd4 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Thu, 13 Mar 2025 10:07:04 +0100 Subject: [PATCH] persisting_state_of_components.md: Emphasize immutability and thread safety of SerializablePersistentStateComponent --- topics/basics/persisting_state_of_components.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/topics/basics/persisting_state_of_components.md b/topics/basics/persisting_state_of_components.md index 7fc6bd4ee..10829f7e8 100644 --- a/topics/basics/persisting_state_of_components.md +++ b/topics/basics/persisting_state_of_components.md @@ -61,10 +61,10 @@ class MySettings : SimplePersistentStateComponent(State()) { -[`SerializablePersistentStateComponent`](%gh-ic%/platform/projectModel-api/src/com/intellij/openapi/components/SerializablePersistentStateComponent.kt) is parameterized with a state data class. +[`SerializablePersistentStateComponent`](%gh-ic%/platform/projectModel-api/src/com/intellij/openapi/components/SerializablePersistentStateComponent.kt) is parameterized with an immutable state data class. -State properties are exposed via persistent state component class' properties. -The state properties are modified by copying the state and overwriting a modified value within `SerializablePersistentStateComponent.updateState()`, which ensures atomic modification. +State properties are exposed for reading and modification via persistent state component class' properties. +The state properties are modified by copying the state and overwriting a modified value within `SerializablePersistentStateComponent.updateState()`, which ensures atomic modification and thread safety. Example: