Skip to content

Commit

Permalink
Fix deserializability of AddJaxbRuntime
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Sep 6, 2023
1 parent 84d76c3 commit 3375005
Showing 1 changed file with 10 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
import java.time.Duration;
import java.util.*;

@EqualsAndHashCode(callSuper = true)
@Value
@EqualsAndHashCode(callSuper = false)
public class AddJaxbRuntime extends Recipe {

private static final String JAKARTA_API_GROUP = "jakarta.xml.bind";
private static final String JAKARTA_API_ARTIFACT = "jakarta.xml.bind-api";

Expand All @@ -49,16 +49,7 @@ public class AddJaxbRuntime extends Recipe {
description = "Which implementation of the JAXB run-time that will be added to maven projects that have transitive dependencies on the JAXB API",
valid = {"glassfish", "sun"},
example = "glassfish")
private final String runtime;

private final AddJaxbRuntimeGradle addJaxbRuntimeGradle;
private final AddJaxbRuntimeMaven addJaxbRuntimeMaven;

public AddJaxbRuntime(String runtime) {
this.runtime = runtime;
this.addJaxbRuntimeGradle = new AddJaxbRuntimeGradle(runtime);
this.addJaxbRuntimeMaven = new AddJaxbRuntimeMaven(runtime);
}
String runtime;

@Override
public String getDisplayName() {
Expand Down Expand Up @@ -91,12 +82,12 @@ public boolean causesAnotherCycle() {

@Override
public List<Recipe> getRecipeList() {
return Arrays.asList(addJaxbRuntimeGradle, addJaxbRuntimeMaven);
return Arrays.asList(new AddJaxbRuntimeGradle(runtime), new AddJaxbRuntimeMaven(runtime));
}

@Value
@EqualsAndHashCode(callSuper = true)
private static class AddJaxbRuntimeGradle extends Recipe {
@EqualsAndHashCode(callSuper = false)
static class AddJaxbRuntimeGradle extends Recipe {
String runtime;

@Override
Expand Down Expand Up @@ -216,8 +207,8 @@ private org.openrewrite.gradle.AddDependencyVisitor addDependency(String configu
}

@Value
@EqualsAndHashCode(callSuper = true)
private static class AddJaxbRuntimeMaven extends Recipe {
@EqualsAndHashCode(callSuper = false)
static class AddJaxbRuntimeMaven extends Recipe {
String runtime;

@Override
Expand Down Expand Up @@ -324,4 +315,5 @@ private Scope getTransitiveDependencyScope(MavenResolutionResult mavenModel, Str
};
}
}
}

}

0 comments on commit 3375005

Please sign in to comment.