Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions metafix/src/main/java/org/metafacture/metafix/FixMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void apply(final Metafix metafix, final Record record, final List<String>

h.forEach((subField, value) -> {
record.addNested(field, new Value(subField));
record.addNested(field, value);
record.addNested(field, value.withPathSet(null));
});
})));
}
Expand Down Expand Up @@ -210,9 +210,9 @@ public void apply(final Metafix metafix, final Record record, final List<String>
oldValue.matchType()
.ifArray(a -> {
record.remove(newName);
a.forEach(v -> record.addNested(newName, v));
a.forEach(v -> record.addNested(newName, v.withPathSet(null)));
})
.orElse(v -> record.set(newName, v));
.orElse(v -> record.set(newName, v.withPathSet(null)));
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2188,10 +2188,9 @@ public void inDoBindCopyFieldWithVarInSourceAndTarget() {
);
}

@Test
public void replaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTarget() {
private void replaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTarget(final boolean explicitArray) {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"set_array('RSWK[]')",
explicitArray ? "set_array('RSWK[]')" : "",
"do list(path: '650??', 'var': '$i')",
" copy_field('$i.a', 'RSWK[].$append.subjectTopicName')",
" copy_field('$i.v', 'RSWK[].$last.subjectGenre')",
Expand Down Expand Up @@ -2227,6 +2226,16 @@ public void replaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTarget() {
);
}

@Test
public void replaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTarget() {
replaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTarget(true);
}

@Test
public void replaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTargetImplicitArray() {
replaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTarget(false);
}

@Test
public void multipleReplaceAllWithWildcardAfterCopyFieldWithVarInSourceAndTarget() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
Expand Down

This file was deleted.