Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
@RequiredArgsConstructor
public class AddJDeprScanPlugin extends Recipe {

@Option(displayName = "release", description = "Specifies the Java SE release that provides the set of deprecated APIs for scanning.", required = false, example = "11")
@Option(displayName = "Release", description = "Specifies the Java SE release that provides the set of deprecated APIs for scanning.", required = false, example = "11")
private final String release;

@Getter
final String displayName = "Add `JDeprScan` Maven Plug-in";
final String displayName = "Add `JDeprScan` Maven plugin";

@Getter
final String description = "Add the `JDeprScan` Maven plugin to scan class files for uses of deprecated APIs.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@
public class AddMissingMethodImplementation extends Recipe {

@Option(displayName = "Fully qualified class name",
description = "A fully qualified class being implemented with missing method.",
description = "The fully qualified name of the interface whose method may be missing from its implementations.",
example = "com.yourorg.FooBar")
String fullyQualifiedClassName;

@Option(displayName = "Method pattern",
description = "A method pattern for matching required method definition.",
description = "A method pattern matching the required method declaration.",
example = "*..* hello(..)")
String methodPattern;

@Option(displayName = "Method template",
description = "Template of method to add",
description = "Template of the method to add.",
example = "public String hello() { return \\\"Hello from #{}!\\\"; }")
String methodTemplateString;

String displayName = "Adds missing method implementations";
String displayName = "Add missing method implementations";

String description = "Check for missing methods required by interfaces and adds them.";
String description = "Add a method to classes that implement the given interface but are missing the method.";

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class AddMockitoJavaAgentToMavenSurefirePlugin extends Recipe {
private static final String CONFIGURATION_TAG_TEMPLATE = "<configuration>\n<!--suppress MavenModelInspection --><argLine>%s</argLine></configuration>";

@Getter
final String displayName = "Add Mockito Java Agent to Maven Surefire Plugin";
final String displayName = "Add Mockito Java agent to Maven Surefire plugin";

@Getter
final String description = "Mockito attaches its Byte Buddy agent to the running JVM at test time, which the JDK has " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AddStaticVariableOnProducerSessionBean extends ScanningRecipe<Set<S
private static final XPathMatcher EJB_PATH = new XPathMatcher("ejb-jar/enterprise-beans/session");

@Getter
final String displayName = "Adds `static` modifier to `@Produces` fields that are in session beans";
final String displayName = "Add `static` modifier to `@Produces` fields in session beans";

@Getter
final String description = "Ensures that the fields annotated with `@Produces` which is inside the session bean (`@Stateless`, `@Stateful`, or `@Singleton`) are declared `static`.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public class AddSuppressionForIllegalReflectionWarningsPlugin extends Recipe {
private final String version;

@Getter
final String displayName = "Add maven jar plugin to suppress illegal reflection warnings";
final String displayName = "Add `maven-jar-plugin` to suppress illegal reflection warnings";

@Getter
final String description = "Adds a maven jar plugin that's configured to suppress Illegal Reflection Warnings.";
final String description = "Adds a `maven-jar-plugin` with `Add-Opens` manifest entries to `war` and `ear` modules to suppress illegal reflection warnings.";

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
public class AddSurefireFailsafeArgLine extends Recipe {

@Option(displayName = "Arg line",
description = "The arguments to add to the surefire and failsafe plugin `argLine` configuration. " +
"Individual arguments are space-separated. Arguments already present in the existing argLine are not duplicated.",
description = "The arguments to add to the Maven Surefire and Failsafe plugin `argLine` configuration. " +
"Individual arguments are space-separated. Arguments already present in the existing `argLine` are not duplicated.",
example = "--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED")
String argLine;

String displayName = "Add `argLine` to surefire and failsafe plugins";
String displayName = "Add `argLine` to Maven Surefire and Failsafe plugins";

String description = "Adds the specified arguments to the `argLine` configuration of the Maven Surefire and Failsafe plugins, " +
"merging with any existing argLine value without duplicating arguments. " +
"merging with any existing `argLine` value without duplicating arguments. " +
"The `@{argLine}` [late property reference](https://maven.apache.org/surefire/maven-surefire-plugin/faq.html) is prepended " +
"so that an agent injected by another plugin during the build, such as the JaCoCo coverage agent from " +
"`jacoco-maven-plugin:prepare-agent`, is preserved rather than overwritten. It is not added when the existing " +
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/openrewrite/java/migrate/BeanDiscovery.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class BeanDiscovery extends Recipe {
private static final XPathMatcher BEANS_MATCHER = new XPathMatcher("/beans");
private static final Pattern VERSION_PATTERN = Pattern.compile("_([^\\/\\.]+)\\.xsd");

String displayName = "Behavior change to bean discovery in modules with `beans.xml` file with no version specified";
String displayName = "Add `version` and `bean-discovery-mode` to `beans.xml` files without a version";

String description = "Alters beans with missing version attribute to include this attribute as well as the bean-discovery-mode=\"all\" attribute to maintain an explicit bean archive.";
String description = "Alters `beans.xml` files with a missing `version` attribute to include this attribute as well as `bean-discovery-mode=\"all\"`, to maintain an explicit bean archive.";

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public class ChangeDefaultKeyStore extends Recipe {
private static final MethodMatcher KEYSTORE_METHOD_REF = new MethodMatcher("java.security.KeyStore getDefaultType()");

@Getter
final String displayName = "Return String `jks` when `KeyStore.getDefaultType()` is called";
final String displayName = "Replace `KeyStore.getDefaultType()` with `\"jks\"`";

@Getter
final String description = "In Java 11 the default keystore was updated from JKS to PKCS12. " +
"As a result, applications relying on KeyStore.getDefaultType() may encounter issues after migrating, " +
"As a result, applications relying on `KeyStore.getDefaultType()` may encounter issues after migrating, " +
"unless their JKS keystore has been converted to PKCS12. " +
"This recipe returns default key store of `jks` when `KeyStore.getDefaultType()` method is called to " +
"use the pre Java 11 default keystore.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class IllegalArgumentExceptionToAlreadyConnectedException extends Recipe
final String displayName = "Replace `IllegalArgumentException` with `AlreadyConnectedException` in `DatagramChannel.send()` method";

@Getter
final String description = "Replace `IllegalArgumentException` with `AlreadyConnectedException` for DatagramChannel.send() to ensure compatibility with Java 11+.";
final String description = "Replace `IllegalArgumentException` with `AlreadyConnectedException` for `DatagramChannel.send()` to ensure compatibility with Java 11+.";

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public JREThrowableFinalMethods(
final String displayName = "Rename final method declarations `getSuppressed()` and `addSuppressed(Throwable exception)` in classes that extend `Throwable`";

@Getter
final String description = "The recipe renames `getSuppressed()` and `addSuppressed(Throwable exception)` methods in classes " +
final String description = "The recipe renames `getSuppressed()` and `addSuppressed(Throwable exception)` methods in classes " +
"that extend `java.lang.Throwable` to `myGetSuppressed` and `myAddSuppressed(Throwable)`. " +
"These methods were added to Throwable in Java 7 and are marked final which cannot be overridden.";
"These methods were added to `Throwable` in Java 7 and are marked final which cannot be overridden.";

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/openrewrite/java/migrate/MXBeanRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
@Value
public class MXBeanRule extends Recipe {

String displayName = "MBean and MXBean interfaces must be public";
String displayName = "Make MBean and MXBean interfaces public";

String description = "Sets visibility of MBean and MXBean interfaces to public.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
@EqualsAndHashCode(callSuper = false)
public class MigrateGraalVMResourceConfig extends Recipe {

String displayName = "Migrate GraalVM resource-config.json to glob patterns";
String displayName = "Migrate GraalVM `resource-config.json` to glob patterns";

String description = "Migrates GraalVM native-image resource-config.json files from the legacy regex pattern format " +
String description = "Migrates GraalVM `native-image` `resource-config.json` files from the legacy regex pattern format " +
"(JDK 21 and earlier) to the new glob pattern format (JDK 23+). " +
"Converts `pattern` entries to `glob` entries and restructures the format. " +
"Note: `excludes` are no longer supported in the new format and will be removed.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class RemovedSecurityManagerMethods extends Recipe {
private static final MethodMatcher METHOD_PATTERN_WINDOW = new MethodMatcher("java.lang.SecurityManager checkTopLevelWindow(..)", false);

@Getter
final String displayName = "Replace deprecated methods in`SecurityManager`";
final String displayName = "Replace deprecated methods in `SecurityManager`";

@Getter
final String description = "Replace `SecurityManager` methods `checkAwtEventQueueAccess()`, `checkSystemClipboardAccess()`, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
@Value
public class ReplaceAWTGetPeerMethod extends Recipe {

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`getPeer` method pattern",
description = "A method pattern matching the `getPeer()` method to replace.",
example = "java.awt.* getPeer()",
required = false)
String getPeerMethodPattern;

@Option(displayName = "The LightweightPeer interface FQCN",
description = "The fully qualified class name of the LightweightPeer interface to replace in `instanceof`.",
@Option(displayName = "`LightweightPeer` interface",
description = "The fully qualified name of the `LightweightPeer` interface to replace in `instanceof`.",
example = "java.awt.peer.LightweightPeer",
required = false)
String lightweightPeerFQCN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,52 @@
@Value
public class ReplaceComSunAWTUtilitiesMethods extends Recipe {

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`isTranslucencySupported` method pattern",
description = "A method pattern matching the `AWTUtilities.isTranslucencySupported(Translucency)` method to replace. " +
"Defaults to the method on `com.sun.awt.AWTUtilities`.",
example = "com.sun.awt.AWTUtilities isTranslucencySupported(com.sun.awt.AWTUtilities.Translucency)",
required = false)
String getAWTIsWindowsTranslucencyPattern;


@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`isWindowOpaque` method pattern",
description = "A method pattern matching the `AWTUtilities.isWindowOpaque(Window)` method to replace. " +
"Defaults to the method on `com.sun.awt.AWTUtilities`.",
example = "com.test.AWTUtilities isWindowOpaque(java.awt.Window)",
required = false)
String isWindowOpaquePattern;

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`isTranslucencyCapable` method pattern",
description = "A method pattern matching the `AWTUtilities.isTranslucencyCapable(GraphicsConfiguration)` method to replace. " +
"Defaults to the method on `com.sun.awt.AWTUtilities`.",
example = "com.test.AWTUtilities isTranslucencyCapable(java.awt.GraphicsConfiguration)",
required = false)
String isTranslucencyCapablePattern;

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`setWindowOpacity` method pattern",
description = "A method pattern matching the `AWTUtilities.setWindowOpacity(Window, float)` method to replace. " +
"Defaults to the method on `com.sun.awt.AWTUtilities`.",
example = "com.test.AWTUtilities setWindowOpacity(java.awt.Window, float)",
required = false)
String setWindowOpacityPattern;

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`getWindowOpacity` method pattern",
description = "A method pattern matching the `AWTUtilities.getWindowOpacity(Window)` method to replace. " +
"Defaults to the method on `com.sun.awt.AWTUtilities`.",
example = "com.test.AWTUtilities getWindowOpacity(java.awt.Window)",
required = false)
String getWindowOpacityPattern;

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`getWindowShape` method pattern",
description = "A method pattern matching the `AWTUtilities.getWindowShape(Window)` method to replace. " +
"Defaults to the method on `com.sun.awt.AWTUtilities`.",
example = "com.test.AWTUtilitiesTest getWindowShape(java.awt.Window)",
required = false)
String getWindowShapePattern;

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`setComponentMixingCutoutShape` method pattern",
description = "A method pattern matching the `AWTUtilities.setComponentMixingCutoutShape(Component, Shape)` method to replace. " +
"Defaults to the method on `com.sun.awt.AWTUtilities`.",
example = "com.test.AWTUtilities setComponentMixingCutoutShape(java.awt.Component,java.awt.Shape)",
required = false)
String setComponentMixingCutoutShapePattern;
Expand Down Expand Up @@ -104,7 +111,7 @@ public ReplaceComSunAWTUtilitiesMethods(

String displayName = "Replace `com.sun.awt.AWTUtilities` static method invocations";

String description = "This recipe replaces several static calls in `com.sun.awt.AWTUtilities` with the JavaSE 11 equivalent. " +
String description = "This recipe replaces several static calls in `com.sun.awt.AWTUtilities` with the JavaSE 11 equivalent. " +
"The methods replaced are `AWTUtilities.isTranslucencySupported()`, `AWTUtilities.setWindowOpacity()`, `AWTUtilities.getWindowOpacity()`, " +
"`AWTUtilities.getWindowShape()`, `AWTUtilities.isWindowOpaque()`, `AWTUtilities.isTranslucencyCapable()` and `AWTUtilities.setComponentMixingCutoutShape()`.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
@Value
public class ReplaceLocalizedStreamMethods extends Recipe {

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`getLocalizedInputStream` method pattern",
description = "A method pattern matching the `getLocalizedInputStream(InputStream)` method to replace. " +
"Defaults to the method on `java.lang.Runtime`.",
example = "java.lang.Runtime getLocalizedInputStream(java.io.InputStream)",
required = false)
String localizedInputStreamMethodMatcher;

@Option(displayName = "Method pattern to replace",
description = "The method pattern to match and replace.",
@Option(displayName = "`getLocalizedOutputStream` method pattern",
description = "A method pattern matching the `getLocalizedOutputStream(OutputStream)` method to replace. " +
"Defaults to the method on `java.lang.Runtime`.",
example = "java.lang.Runtime getLocalizedOutputStream(java.io.OutputStream)",
required = false)
String localizedOutputStreamMethodMatcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@EqualsAndHashCode(callSuper = false)
public class SimplifySecurityManagerThreadGroup extends Recipe {
String displayName = "Simplify the removed security manager's thread group fallback";
String description = "Remove a null SecurityManager local used only by the immediately following thread group conditional.";
String description = "Remove a `null` `SecurityManager` local used only by the immediately following thread group conditional.";

@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/openrewrite/java/migrate/UpdateSdkMan.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ public class UpdateSdkMan extends Recipe {
@Nullable
String newDistribution;

String displayName = "Update SDKMan Java version";
String displayName = "Update SDKMAN! Java version";

String description = "Update the SDKMAN JDK version in the `.sdkmanrc` file. Given a major release (e.g., 17), the recipe " +
"will update the current distribution to the current default SDKMAN version of the specified major " +
String description = "Update the SDKMAN! JDK version in the `.sdkmanrc` file. Given a major release (e.g., 17), the recipe " +
"will update the current distribution to the current default SDKMAN! version of the specified major " +
"release. The distribution option can be used to specify a specific JVM distribution. " +
"Note that these must correspond to valid SDKMAN distributions.";
"Note that these must correspond to valid SDKMAN! distributions.";

@Override
public Validated<Object> validate(ExecutionContext ctx) {
Expand Down
Loading
Loading