Merge branch '3.5.x'

Closes gh-48283
This commit is contained in:
Stéphane Nicoll
2025-11-25 10:01:24 +01:00
2 changed files with 5 additions and 5 deletions
@@ -52,12 +52,12 @@ public class ContextPairs {
/**
* Add pairs using flat naming.
* @param <T> the item type
* @param delimeter the delimiter used if there is a prefix
* @param delimiter the delimiter used if there is a prefix
* @param pairs callback to add all the pairs
* @return a {@link BiConsumer} for use with the {@link JsonWriter}
*/
public <T> BiConsumer<T, BiConsumer<String, Object>> flat(String delimeter, Consumer<Pairs<T>> pairs) {
return flat(joinWith(delimeter), pairs);
public <T> BiConsumer<T, BiConsumer<String, Object>> flat(String delimiter, Consumer<Pairs<T>> pairs) {
return flat(joinWith(delimiter), pairs);
}
/**
@@ -58,7 +58,7 @@ class ContextPairsTests {
}
@Test
void flatWhenPrefixEndingWithDelimeterAppliesPrefix() {
void flatWhenPrefixEndingWithDelimiterAppliesPrefix() {
ContextPairs contextPairs = new ContextPairs(true, "the_");
Map<String, String> map = Map.of("spring", "boot");
Map<String, Object> actual = apply(contextPairs.flat("_", (pairs) -> pairs.addMapEntries((item) -> map)));
@@ -66,7 +66,7 @@ class ContextPairsTests {
}
@Test
void flatWhenPrefixAndNameStartingWithDelimeterAppliesPrefix() {
void flatWhenPrefixAndNameStartingWithDelimiterAppliesPrefix() {
ContextPairs contextPairs = new ContextPairs(true, "the");
Map<String, String> map = Map.of("_spring", "boot");
Map<String, Object> actual = apply(contextPairs.flat("_", (pairs) -> pairs.addMapEntries((item) -> map)));