Skip to content

Commit

Permalink
Upgrade bundled version of snakeyaml
Browse files Browse the repository at this point in the history
  • Loading branch information
sambsnyd committed Jun 10, 2024
1 parent f624d4e commit 5a4b688
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Enforce logging best practices and migrate between logging framew
def rewriteVersion = rewriteRecipe.rewriteVersion.get()

recipeDependencies {
parserClasspath("org.yaml:snakeyaml:1.33")
parserClasspath("org.yaml:snakeyaml:2.2")
parserClasspath("com.fasterxml.jackson.core:jackson-core:2.13.+")
parserClasspath("com.fasterxml.jackson.core:jackson-databind:2.13.+")
parserClasspath("org.springframework:spring-context:5.+")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public J visitMemberReference(J.MemberReference memberRef, ExecutionContext ctx)
.imports("org.yaml.snakeyaml.Yaml")
.imports("org.yaml.snakeyaml.constructor.SafeConstructor")
.javaParser(JavaParser.fromJavaVersion()
.classpathFromResources(ctx, "snakeyaml-1.33"))
.classpathFromResources(ctx, "snakeyaml"))
.build()
.apply(getCursor(), memberRef.getCoordinates().replace());
}
Expand All @@ -86,7 +86,7 @@ public J visitNewClass(J.NewClass newClass, ExecutionContext ctx) {
.imports("org.yaml.snakeyaml.Yaml")
.imports("org.yaml.snakeyaml.constructor.SafeConstructor")
.javaParser(JavaParser.fromJavaVersion()
.classpathFromResources(ctx, "snakeyaml-1.33"))
.classpathFromResources(ctx, "snakeyaml"))
.build()
.apply(getCursor(), newClass.getCoordinates().replace());
} else if (snakeYamlRepresenterArgumentConstructor.matches(newClass)) {
Expand All @@ -104,7 +104,7 @@ public J visitNewClass(J.NewClass newClass, ExecutionContext ctx) {
"org.yaml.snakeyaml.representer.Representer"
)
.javaParser(JavaParser.fromJavaVersion()
.classpathFromResources(ctx, "snakeyaml-1.33"))
.classpathFromResources(ctx, "snakeyaml"))
.build()
.apply(getCursor(), newClass.getCoordinates().replace(), newClass.getArguments().get(0));
} else if (snakeYamlDumperArgumentConstructor.matches(newClass)) {
Expand All @@ -122,7 +122,7 @@ public J visitNewClass(J.NewClass newClass, ExecutionContext ctx) {
"org.yaml.snakeyaml.representer.Representer"
)
.javaParser(JavaParser.fromJavaVersion()
.classpathFromResources(ctx, "snakeyaml-1.33"))
.classpathFromResources(ctx, "snakeyaml"))
.build()
.apply(getCursor(), newClass.getCoordinates().replace(), newClass.getArguments().get(0));
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SecureSnakeYamlConstructorTest implements RewriteTest {
public void defaults(RecipeSpec spec) {
spec.recipe(new SecureSnakeYamlConstructor())
.parser(JavaParser.fromJavaVersion()
.classpathFromResources(new InMemoryExecutionContext(), "snakeyaml-1.33"));
.classpathFromResources(new InMemoryExecutionContext(), "snakeyaml"));
}

@DocumentExample
Expand Down

0 comments on commit 5a4b688

Please sign in to comment.