Class JvmLocalPreferences


public final class JvmLocalPreferences extends AbstractPreferences
A process-global, in-memory Preferences tree — the JVM-scoped branch VaadinPreferencesFactory takes when no EmulatorContext is active on the calling thread (D_prefs_scope_split). It exists because SB-Emulators' PreferencesFactory SPI is selected JVM-wide, so callers that have nothing to do with a migrated Swing app — most concretely Vaadin's own commercial-component license checker (com.vaadin.pro.licensechecker.History, which reads/writes Preferences.userNodeForPackage(...) off any UI when an RTE-backed JEditorPane renders) — also land here. Routing those to the browser's localStorage is wrong (no UI to reach, and it isn't the user's data), so they get this instead: a plain heap tree, no browser round-trip, no UI requirement, never throws.

Ephemeral by design. Nothing persists across JVM restarts. For the license checker that means its "last check" cache starts cold each boot (it re-validates rather than throttling — correct, just unthrottled). In-memory is chosen over delegating to the JDK's file store precisely so a misclassified app-pref write (migrated code on a raw background thread that never propagated its EmulatorContext) is lost to a process-local heap rather than silently persisted to the server's shared ~/.java/.userPrefs — the wrong machine, and cross-user on a deployed server. See D_prefs_scope_split.

Thread-safe: AbstractPreferences holds each node's lock across its *Spi calls, and the per-node maps are ConcurrentHashMap so the cross-node child registry is safe too.