-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
Runtime.runFinalizersOnExit()
in upgrade to Java 11 (#244)
* replace runtime finalizer recipe * formatted * fixed recipe based on review comments * recipe logic changes * Remove methods with a single reusable recipe * Add license --------- Co-authored-by: Tim te Beek <[email protected]>
- Loading branch information
1 parent
00bef97
commit 1349e83
Showing
11 changed files
with
138 additions
and
439 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/main/java/org/openrewrite/java/migrate/RemoveMethodInvocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2023 the original author or authors. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.openrewrite.java.migrate; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import org.openrewrite.ExecutionContext; | ||
import org.openrewrite.Option; | ||
import org.openrewrite.Recipe; | ||
import org.openrewrite.TreeVisitor; | ||
import org.openrewrite.internal.lang.NonNull; | ||
import org.openrewrite.java.MethodMatcher; | ||
import org.openrewrite.staticanalysis.RemoveMethodCallVisitor; | ||
|
||
public class RemoveMethodInvocation extends Recipe { | ||
@Option(displayName = "Method Pattern", | ||
description = "A method pattern for matching required method definition.", | ||
example = "*..* hello(..)") | ||
@NonNull | ||
private String methodPattern; | ||
|
||
@JsonCreator | ||
public RemoveMethodInvocation(@JsonProperty("methodPattern") String methodPattern) { | ||
this.methodPattern = methodPattern; | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Remove methods calls"; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Checks for a method patterns and removes the method call from the class."; | ||
} | ||
|
||
@Override | ||
public TreeVisitor<?, ExecutionContext> getVisitor() { | ||
return new RemoveMethodCallVisitor<>(new MethodMatcher(methodPattern), (n, it) -> true); | ||
} | ||
} |
85 changes: 0 additions & 85 deletions
85
src/main/java/org/openrewrite/java/migrate/jakarta/RemoveMethods.java
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
src/main/java/org/openrewrite/java/migrate/lang/RemoveRuntimeTraceMethods.java
This file was deleted.
Oops, something went wrong.
72 changes: 0 additions & 72 deletions
72
src/main/java/org/openrewrite/java/migrate/lang/RemoveThreadDestroyMethod.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.