-
Notifications
You must be signed in to change notification settings - Fork 101
Removing deprecated Runtime trace methods in move to Java 17 #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing deprecated Runtime trace methods in move to Java 17 #247
Conversation
For context: this was removed in Java 13
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions already, after checking out your branch locally and running through the changes.
In general I can say the code snippets in the tests were not yet valid for any version of Java; you can fix that through my code suggestions that you can apply all at once from this page: https://github.com/openrewrite/rewrite-migrate-java/pull/247/files
The recipe does not make the best use of the type system, possibly due to limitations with replacing methods formerly in the JDK. Not sure if there's a better way, as I struggled with forcing the test and replacements to use older versions of Java, and still did not get the method type to show. We can keep things as they are for now, as there's unlikely to arise any conflicts given that these methods are already on java.lang.Runtime
.
And of course thanks a lot for these changes already! Good to get these removed for any upgrade to the Java runtime.
src/test/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntimeTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntimeTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntimeTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntimeTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntimeTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntime.java
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntime.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/migrate/lang/RemoveDeprecatedRuntime.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate your patience in getting this through @satvika-eda ! I've pushed a polishing commit and included this in the migration to Java 17, accepting that we can not properly test this with the way our tests are set up. Thanks again!
What's changed?
Remove deprecated invocations of Runtime.traceInstructions() and Runtime.traceMethodCalls() which have no alternatives needed.
What's your motivation?
To automate JDK migration to a greater extent
Checklist
./gradlew licenseFormat