Skip to content

Commit

Permalink
Add missing example values for UseAsBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Feb 4, 2024
1 parent fe75588 commit b38c77c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/main/java/org/openrewrite/staticanalysis/UseAsBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,23 @@
public class UseAsBuilder extends Recipe {
@Option(
displayName = "Builder Type",
description = "Fully qualified name of the Builder"
)
description = "Fully qualified name of the Builder",
example = "org.example.Buildable.Builder")
String builderType;

@Option(
displayName = "Immutable state",
description = "The builder is immutable if you must assign the result of calls to intermediate variables " +
"or use directly. Defaults to true as many purpose-built builders will be immutable.",
required = false
)
required = false)
@Nullable
Boolean immutable;

@Option(
displayName = "Builder creator method",
description = "The method that creates the builder instance, which may not be a method of the builder itself.",
required = false
)
required = false,
example = "org.example.Buildable builder()")
@Nullable
String builderCreator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void changeApplicableNestedClass() {
public class A {
public A() {}
public static String foo() { return "foo"; }
private static class Builder() {
private static class Builder {
public Builder() {}
public static String foo() { return "foo"; }
}
Expand All @@ -167,7 +167,7 @@ public Builder() {}
public class A {
private A() {}
public static String foo() { return "foo"; }
private static class Builder() {
private static class Builder {
private Builder() {}
public static String foo() { return "foo"; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public class VehicleUsage {
private final String vehicleId;
}
public doSomethingWithAVehicle() {
public void doSomethingWithAVehicle() {
vehicleUsage = new VehicleUsage();
vehicleUsage.vehicleId = "vu50";
}
Expand Down

0 comments on commit b38c77c

Please sign in to comment.