Skip to content

Commit

Permalink
Removal of values in a INISet not firing events.
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-smith committed Jun 8, 2024
1 parent 4c52e90 commit 9550d9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ Note that a `store` is scoped, and should be closed when finished with.

## Changes

### 0.3.3

* Fixes for reloading.
* Removal of value events not fired by `INISet`.


### 0.3.2

* More work on `INISchema`, can now wrap an `INI` to provide a proxied instance that guarantees correctness.
Expand Down
12 changes: 2 additions & 10 deletions config/src/main/java/com/sshtools/jini/config/INISet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.text.MessageFormat;
import java.text.ParseException;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -684,15 +682,9 @@ private void mergeValues(Data oldDoc, Data newDoc, boolean init) {
}

if (!init) {
for (var it = oldDoc.keys().iterator(); it.hasNext();) {
var key = it.next();
for (var key : new ArrayList<>(oldDoc.keys())) {
if (!newDoc.contains(key)) {
if (!init) {
if (newDoc instanceof Section) {
var sec = (Section)newDoc;
}
}
it.remove();
oldDoc.remove(key);
}
}
}
Expand Down

0 comments on commit 9550d9c

Please sign in to comment.