From e7e67328ef1555a544fd4fd815847b730fe244cf Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Fri, 7 Feb 2025 19:38:50 +0100 Subject: [PATCH] Add null arguments to MergeYaml usage --- .../java/org/openrewrite/java/spring/AddSpringProperty.java | 2 +- .../spring/boot2/MergeBootstrapYamlWithApplicationYaml.java | 2 +- .../java/spring/boot2/MigrateDatabaseCredentials.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openrewrite/java/spring/AddSpringProperty.java b/src/main/java/org/openrewrite/java/spring/AddSpringProperty.java index 06c2ad691..8681d6887 100644 --- a/src/main/java/org/openrewrite/java/spring/AddSpringProperty.java +++ b/src/main/java/org/openrewrite/java/spring/AddSpringProperty.java @@ -140,7 +140,7 @@ private MergeYaml createMergeYamlVisitor() { } else { yaml.append(" ").append(value); } - return new MergeYaml("$", yaml.toString(), true, null, null); + return new MergeYaml("$", yaml.toString(), true, null, null, null); } private static final Pattern scalarNeedsAQuote = Pattern.compile("[^a-zA-Z\\d\\s]*"); diff --git a/src/main/java/org/openrewrite/java/spring/boot2/MergeBootstrapYamlWithApplicationYaml.java b/src/main/java/org/openrewrite/java/spring/boot2/MergeBootstrapYamlWithApplicationYaml.java index c25b51022..d68dd6b13 100644 --- a/src/main/java/org/openrewrite/java/spring/boot2/MergeBootstrapYamlWithApplicationYaml.java +++ b/src/main/java/org/openrewrite/java/spring/boot2/MergeBootstrapYamlWithApplicationYaml.java @@ -110,7 +110,7 @@ public TreeVisitor getVisitor(Accumulator acc) { source = new CoalescePropertiesVisitor().visitDocuments(a.withDocuments(ListUtils.map((List) a.getDocuments(), doc -> { if (merged.compareAndSet(false, true) && FindProperty.find(doc, "spring.config.activate.on-profile", true).isEmpty()) { return (Yaml.Document) new MergeYamlVisitor(doc.getBlock(), b.getDocuments() - .get(0).getBlock(), true, null).visit(doc, 0, new Cursor(new Cursor(null, a), doc)); + .get(0).getBlock(), true, null, null).visit(doc, 0, new Cursor(new Cursor(null, a), doc)); } return doc; })), 0); diff --git a/src/main/java/org/openrewrite/java/spring/boot2/MigrateDatabaseCredentials.java b/src/main/java/org/openrewrite/java/spring/boot2/MigrateDatabaseCredentials.java index 160dd5282..f4af2d928 100644 --- a/src/main/java/org/openrewrite/java/spring/boot2/MigrateDatabaseCredentials.java +++ b/src/main/java/org/openrewrite/java/spring/boot2/MigrateDatabaseCredentials.java @@ -90,8 +90,8 @@ public Yaml visitDocuments(Yaml.Documents documents, ExecutionContext ctx) { }, new YamlVisitor() { @Override public Yaml visitDocuments(Yaml.Documents documents, ExecutionContext ctx) { - doAfterVisit(new MergeYaml("$.spring." + tool, "username: ${spring.datasource.username}", true, null, null).getVisitor()); - doAfterVisit(new MergeYaml("$.spring." + tool, "password: ${spring.datasource.password}", true, null, null).getVisitor()); + doAfterVisit(new MergeYaml("$.spring." + tool, "username: ${spring.datasource.username}", true, null, null, null).getVisitor()); + doAfterVisit(new MergeYaml("$.spring." + tool, "password: ${spring.datasource.password}", true, null, null, null).getVisitor()); doAfterVisit(new CoalesceProperties().getVisitor()); return documents; }