I came across the documentation of the flush () method, which states that the method is needed to force changes in the node. Isn’t the change per se applied instantly when writing to the Preferences? It means writing through
preferences.node(String name)- create nodepreferences.put(String key, String value)- adding a key-value to the nodePreferences.importPreferences(InputStream is)- import preferences from a stream (file, for example)
I personally don’t understand the Java sources in terms of how the Preferences class works. Can anyone explain in which cases the preferences.flush() need to be applied and what happens if this is not done?