diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java index 21865c00593..bd60f386c5b 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java @@ -541,11 +541,7 @@ private static class SequenceWithPrefix extends Yaml.Sequence { private String prefix; public SequenceWithPrefix(String prefix, @Nullable String startBracketPrefix, List entries, @Nullable String endBracketPrefix, @Nullable Anchor anchor) { - this(randomId(), Markers.EMPTY, prefix, startBracketPrefix, entries, endBracketPrefix, anchor); - } - - private SequenceWithPrefix(UUID id, Markers markers, String prefix, @Nullable String startBracketPrefix, List entries, @Nullable String endBracketPrefix, @Nullable Anchor anchor) { - super(id, markers, startBracketPrefix, entries, endBracketPrefix, anchor); + super(randomId(), Markers.EMPTY, startBracketPrefix, entries, endBracketPrefix, anchor); this.prefix = prefix; } @@ -554,14 +550,6 @@ public Sequence withPrefix(String prefix) { this.prefix = prefix; return this; } - - @Override - public Sequence withClosingBracketPrefix(@Nullable String closingBracketPrefix) { - if (Objects.equals(closingBracketPrefix, getClosingBracketPrefix())) { - return this; - } - return new SequenceWithPrefix(getId(), getMarkers(), prefix, getOpeningBracketPrefix(), getEntries(), closingBracketPrefix, getAnchor()); - } } private Yaml.Documents unwrapPrefixedMappings(Yaml.Documents y) { diff --git a/rewrite-yaml/src/test/java/org/openrewrite/yaml/tree/SequenceTest.java b/rewrite-yaml/src/test/java/org/openrewrite/yaml/tree/SequenceTest.java index 34013ddd37e..5c7ed8316f9 100644 --- a/rewrite-yaml/src/test/java/org/openrewrite/yaml/tree/SequenceTest.java +++ b/rewrite-yaml/src/test/java/org/openrewrite/yaml/tree/SequenceTest.java @@ -16,7 +16,6 @@ package org.openrewrite.yaml.tree; import org.junit.jupiter.api.Test; -import org.openrewrite.Issue; import org.openrewrite.test.RewriteTest; import static org.assertj.core.api.Assertions.assertThat; @@ -120,18 +119,6 @@ void sequenceOfMixedSequences() { ); } - @Issue("https://github.com/openrewrite/rewrite/issues/3680") - @Test - void spaceBeforeColon() { - rewriteRun( - yaml( - """ - foo : [] - """ - ) - ); - } - @Test void inlineSequenceWithWhitespaceBeforeCommas() { rewriteRun(