@@ -1854,20 +1854,16 @@ public JSONObject update(String key, Object newValue) throws JSONException {
18541854 final Object oldValue = this .opt (key );
18551855 this .put (key , newValue );
18561856
1857+ this .propertyChangeSupportUpdate .firePropertyChange (JSONObject .propertyChangeGlobalKeyword , oldThis , this );
1858+ this .propertyChangeSupportUpdate .firePropertyChange (key , oldValue , newValue );
18571859
1858- new Thread (() -> {
1859- this .propertyChangeSupportUpdate .firePropertyChange (JSONObject .propertyChangeGlobalKeyword , oldThis , this );
1860- this .propertyChangeSupportUpdate .firePropertyChange (key , oldValue , newValue );
1861- this .propertyChangeSupportNotify .firePropertyChange (key , oldValue , newValue );
1862- }, "json" + key ).start ();
1860+ this .propertyChangeSupportNotify .firePropertyChange (key , oldValue , newValue );
18631861
18641862 return this ;
18651863 }
18661864
18671865 public JSONObject notify (String key , Object oldValue , Object newValue ) throws JSONException {
1868- new Thread (() -> {
1869- this .propertyChangeSupportNotify .firePropertyChange (key , oldValue , newValue );
1870- }, "json" + key ).start ();
1866+ this .propertyChangeSupportNotify .firePropertyChange (key , oldValue , newValue );
18711867
18721868 return this ;
18731869 }
@@ -1952,21 +1948,19 @@ private JSONObject updateOrRemove(JSONObject jo, boolean remove, boolean trigger
19521948 }
19531949
19541950 if (oldValues .size () > 0 ) {
1955- new Thread (() -> {
1956- if (triggerUpdate ) {
1957- this .propertyChangeSupportUpdate .firePropertyChange (JSONObject .propertyChangeGlobalKeyword , oldThis , this );
1958- }
1951+ if (triggerUpdate ) {
1952+ this .propertyChangeSupportUpdate .firePropertyChange (JSONObject .propertyChangeGlobalKeyword , oldThis , this );
1953+ }
19591954
1960- oldValues .forEach ((key , oldValue ) -> {
1961- final Object v2 = delValues .contains (key ) ? null : newValues .get (key );
1962- final Object v1 = oldValue == null && v2 == null ? JSONObject .NULL : oldValue ;
1955+ oldValues .forEach ((key , oldValue ) -> {
1956+ final Object v2 = delValues .contains (key ) ? null : newValues .get (key );
1957+ final Object v1 = oldValue == null && v2 == null ? JSONObject .NULL : oldValue ;
19631958
1964- if (triggerUpdate ) {
1965- this .propertyChangeSupportUpdate .firePropertyChange (key , v1 , v2 );
1966- }
1967- this .propertyChangeSupportNotify .firePropertyChange (key , v1 , v2 );
1968- });
1969- }, "json_GLOBAL" ).start ();
1959+ if (triggerUpdate ) {
1960+ this .propertyChangeSupportUpdate .firePropertyChange (key , v1 , v2 );
1961+ }
1962+ this .propertyChangeSupportNotify .firePropertyChange (key , v1 , v2 );
1963+ });
19701964 }
19711965
19721966 return this ;
0 commit comments