Skip to content

Commit

Permalink
Make recipe classes public:
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Oct 3, 2023
1 parent 685cac2 commit 968eb4d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ApacheCommonsFileUtils {
@RecipeDescriptor(
name = "Replace `FileUtils.getFile(String...)` with JDK internals",
description = "Replace Apache Commons `FileUtils.getFile(String... name)` with JDK internals.")
private static class GetFile {
public static class GetFile {
@BeforeTemplate
File before(String name) {
return FileUtils.getFile(name);
Expand Down Expand Up @@ -56,7 +56,7 @@ File after(String name) {
name = "Replace `FileUtils.writeStringToFile(File, String)` with JDK internals",
description = "Replace Apache Commons `FileUtils.writeStringToFile(File file, String data)` with JDK internals.")
@SuppressWarnings("deprecation")
private static class WriteStringToFile {
public static class WriteStringToFile {
@BeforeTemplate
void before(File a, String s) throws Exception {
FileUtils.writeStringToFile(a, s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ApacheCommonsStringUtils {
@RecipeDescriptor(
name = "Replace `StringUtils.abbreviate(String, int)` with JDK internals",
description = "Replace Apache Commons `StringUtils.abbreviate(String str, int maxWidth)` with JDK internals.")
private static class Abbreviate {
public static class Abbreviate {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s1,
@Matches(RepeatableArgumentMatcher.class) int width) {
Expand All @@ -46,7 +46,7 @@ String after(String s, int width) {
name = "Replace `StringUtils.capitalize(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.capitalize(String str)` with JDK internals.")
@SuppressWarnings("ConstantValue")
private static class Capitalize {
public static class Capitalize {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.capitalize(s);
Expand Down Expand Up @@ -116,7 +116,7 @@ String after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.defaultString(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.defaultString(String str)` with JDK internals.")
private static class DefaultString {
public static class DefaultString {
@BeforeTemplate
String before(String s) {
return StringUtils.defaultString(s);
Expand All @@ -131,7 +131,7 @@ String after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.defaultString(String, String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.defaultString(String str, String nullDefault)` with JDK internals.")
private static class DefaultStringFallback {
public static class DefaultStringFallback {
@BeforeTemplate
String before(String s, String nullDefault) {
return StringUtils.defaultString(s, nullDefault);
Expand All @@ -146,7 +146,7 @@ String after(String s, String nullDefault) {
@RecipeDescriptor(
name = "Replace `StringUtils.deleteWhitespace(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.deleteWhitespace(String str)` with JDK internals.")
private static class DeleteWhitespace {
public static class DeleteWhitespace {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.deleteWhitespace(s);
Expand Down Expand Up @@ -174,7 +174,7 @@ String after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.equalsIgnoreCase(CharSequence, CharSequence)` with JDK internals",
description = "Replace Apache Commons `StringUtils.equalsIgnoreCase(CharSequence cs1, CharSequence cs2)` with JDK internals.")
private static class EqualsIgnoreCase {
public static class EqualsIgnoreCase {
@BeforeTemplate
boolean before(@Matches(RepeatableArgumentMatcher.class) String s,
@Matches(RepeatableArgumentMatcher.class) String other) {
Expand All @@ -190,7 +190,7 @@ boolean after(String s, String other) {
@RecipeDescriptor(
name = "Replace `StringUtils.equals(CharSequence, CharSequence)` with JDK internals",
description = "Replace Apache Commons `StringUtils.equals(CharSequence cs1, CharSequence cs2)` with JDK internals.")
private static class Equals {
public static class Equals {
@BeforeTemplate
boolean before(String s, String other) {
return StringUtils.equals(s, other);
Expand Down Expand Up @@ -351,7 +351,7 @@ boolean after(String s, String other) {
@RecipeDescriptor(
name = "Replace `StringUtils.lowerCase(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.lowerCase(String str)` with JDK internals.")
private static class Lowercase {
public static class Lowercase {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.lowerCase(s);
Expand Down Expand Up @@ -405,7 +405,7 @@ String after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.removeEnd(String, String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.removeEnd(String str, String remove)` with JDK internals.")
private static class RemoveEnd {
public static class RemoveEnd {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s,
@Matches(RepeatableArgumentMatcher.class) String end) {
Expand Down Expand Up @@ -447,7 +447,7 @@ String after(String s, String end) {
@RecipeDescriptor(
name = "Replace `StringUtils.replace(String, String, String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.replace(String text, String searchString, String replacement)` with JDK internals.")
private static class Replace {
public static class Replace {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s,
@Matches(RepeatableArgumentMatcher.class) String search,
Expand All @@ -464,7 +464,7 @@ String after(String s, String search, String replacement) {
@RecipeDescriptor(
name = "Replace `StringUtils.reverse(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.reverse(String str)` with JDK internals.")
private static class Reverse {
public static class Reverse {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.reverse(s);
Expand Down Expand Up @@ -492,7 +492,7 @@ String after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.split(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.split(String str)` with JDK internals.")
private static class Split {
public static class Split {
@BeforeTemplate
String[] before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.split(s);
Expand Down Expand Up @@ -533,7 +533,7 @@ String[] after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.strip(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.strip(String str)` with JDK internals.")
private static class Strip {
public static class Strip {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.strip(s);
Expand Down Expand Up @@ -630,7 +630,7 @@ String after(String s) {
name = "Replace `StringUtils.trimToEmpty(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.trimToEmpty(String str)` with JDK internals.")
@SuppressWarnings("ConstantValue")
private static class TrimToEmpty {
public static class TrimToEmpty {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.trimToEmpty(s);
Expand All @@ -646,7 +646,7 @@ String after(String s) {
name = "Replace `StringUtils.trimToNull(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.trimToNull(String str)` with JDK internals.")
@SuppressWarnings("ConstantValue")
private static class TrimToNull {
public static class TrimToNull {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.trimToNull(s);
Expand All @@ -661,7 +661,7 @@ String after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.trim(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.trim(String str)` with JDK internals.")
private static class Trim {
public static class Trim {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.trim(s);
Expand All @@ -676,7 +676,7 @@ String after(String s) {
@RecipeDescriptor(
name = "Replace `StringUtils.upperCase(String)` with JDK internals",
description = "Replace Apache Commons `StringUtils.upperCase(String str)` with JDK internals.")
private static class Uppercase {
public static class Uppercase {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.upperCase(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public List<Recipe> getRecipeList() {

@Value
@EqualsAndHashCode(callSuper = true)
private static class AddJaxwsRuntimeGradle extends Recipe {
public static class AddJaxwsRuntimeGradle extends Recipe {
@Override
public String getDisplayName() {
return "Use the latest JAX-WS API and runtime for Jakarta EE 8";
Expand Down Expand Up @@ -177,7 +177,7 @@ private Set<String> getTransitiveDependencyConfiguration(GradleProject gp, Strin

@Value
@EqualsAndHashCode(callSuper = true)
private static class AddJaxwsRuntimeMaven extends Recipe {
public static class AddJaxwsRuntimeMaven extends Recipe {
@Override
public String getDisplayName() {
return "Use the latest JAX-WS API and runtime for Jakarta EE 8";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@SuppressWarnings("ALL")
public class MavenSharedStringUtils {

private static class Abbreviate {
public static class Abbreviate {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s1,
@Matches(RepeatableArgumentMatcher.class) int width) {
Expand All @@ -40,7 +40,7 @@ String after(String s, int width) {
}

@SuppressWarnings("ConstantValue")
private static class Capitalize {
public static class Capitalize {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.capitalise(s);
Expand All @@ -52,7 +52,7 @@ String after(String s) {
}
}

private static class DefaultString {
public static class DefaultString {
@BeforeTemplate
String before(String s) {
return StringUtils.defaultString(s);
Expand All @@ -64,7 +64,7 @@ String after(String s) {
}
}

private static class DefaultStringFallback {
public static class DefaultStringFallback {
@BeforeTemplate
String before(String s, String nullDefault) {
return StringUtils.defaultString(s, nullDefault);
Expand All @@ -76,7 +76,7 @@ String after(String s, String nullDefault) {
}
}

private static class DeleteWhitespace {
public static class DeleteWhitespace {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.deleteWhitespace(s);
Expand All @@ -88,7 +88,7 @@ String after(String s) {
}
}

private static class EqualsIgnoreCase {
public static class EqualsIgnoreCase {
@BeforeTemplate
boolean before(@Matches(RepeatableArgumentMatcher.class) String s,
@Matches(RepeatableArgumentMatcher.class) String other) {
Expand All @@ -101,7 +101,7 @@ boolean after(String s, String other) {
}
}

private static class Equals {
public static class Equals {
@BeforeTemplate
boolean before(String s, String other) {
return StringUtils.equals(s, other);
Expand All @@ -113,7 +113,7 @@ boolean after(String s, String other) {
}
}

private static class Lowercase {
public static class Lowercase {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.lowerCase(s);
Expand All @@ -125,7 +125,7 @@ String after(String s) {
}
}

private static class Replace {
public static class Replace {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s,
@Matches(RepeatableArgumentMatcher.class) String search,
Expand All @@ -139,7 +139,7 @@ String after(String s, String search, String replacement) {
}
}

private static class Reverse {
public static class Reverse {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.reverse(s);
Expand All @@ -151,7 +151,7 @@ String after(String s) {
}
}

private static class Split {
public static class Split {
@BeforeTemplate
String[] before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.split(s);
Expand All @@ -163,7 +163,7 @@ String[] after(String s) {
}
}

private static class Strip {
public static class Strip {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.strip(s);
Expand All @@ -175,7 +175,7 @@ String after(String s) {
}
}

private static class Trim {
public static class Trim {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.trim(s);
Expand All @@ -187,7 +187,7 @@ String after(String s) {
}
}

private static class Uppercase {
public static class Uppercase {
@BeforeTemplate
String before(@Matches(RepeatableArgumentMatcher.class) String s) {
return StringUtils.upperCase(s);
Expand Down
Loading

0 comments on commit 968eb4d

Please sign in to comment.