Skip to content

Commit

Permalink
smallrye#216 - Fixed stackoverflow issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez committed Mar 9, 2020
1 parent cd34e8b commit 58f66da
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private static void populateFromEntryNode(StringBuilder valueBuilder, Object o,
for (Map.Entry<String, Object> entry : map.entrySet()) {
escapeMapKey(valueBuilder, entry.getKey(), escapeLevel + 1);
appendEscaped(valueBuilder, '=', escapeLevel);
populateFromEntryNode(valueBuilder, o, escapeLevel + 1);
populateFromEntryNode(valueBuilder, entry.getValue(), escapeLevel + 1);
}
} else if (o instanceof List) {
final Iterator<?> iterator = ((List<?>) o).iterator();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.smallrye.config.source.yaml;

import org.eclipse.microprofile.config.spi.ConfigSource;
import org.junit.Assert;
import org.junit.Test;

public class ArrayTest {

@Test
public void array() {
String yaml = "de:\n" +
" javahippie:\n" +
" mpadmin:\n" +
" instances:\n" +
" -\n" +
" name: \"Bing\"\n" +
" uri: \"https://bing.com\"\n" +
" -\n" +
" name: \"Google\"\n" +
" uri: \"https://www.google.com\"";

ConfigSource src = new YamlConfigSource("Yaml", yaml);
Assert.assertNotNull(src.getValue("de.javahippie.mpadmin.instances"));
}
}

0 comments on commit 58f66da

Please sign in to comment.