-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] Replacing some deprecated methods #15443
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
base: trunk
Are you sure you want to change the base?
[java] Replacing some deprecated methods #15443
Conversation
In several locations I've removed some minor deprecated code and used the the recommended replacements.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
| } | ||
|
|
||
| private String levelNumberToCommonsLevelName(Level level) { | ||
| private static String levelNumberToCommonsLevelName(Level level) { |
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.
Why is this changed?
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.
Oh, that wasn't intentional. Sorry, I'll remove and resubmit.
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.
Thank you
pujagani
left a comment
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.
Thank you @zodac! LGTM
diemol
left a comment
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.
@zodac, could you please resolve the conflicts so I can have a look?
User description
Motivation and Context
There were several places where some deprecated method calls were being used (some for internal project code, others for libraries). Where possible and obvious, I've replaced this code with the non-deprecated methods.
Types of changes
Checklist
bazel test //java/... --test_size_filters=small)PR Type
Enhancement, Bug fix, Tests
Description
Replaced deprecated
newInstancewithgetDeclaredConstructor().newInstancefor reflection-based object creation.Updated
SlowLoadableComponentconstructors to useDuration.ofSecondsfor timeout values.Migrated from
MockitoAnnotations.initMockstoMockitoAnnotations.openMocksin test setup methods.Improved type safety in assertions using
InstanceOfAssertFactoriesin tests.Changes walkthrough 📝
7 files
Replace deprecated
newInstancewithgetDeclaredConstructor().newInstanceUpdate GraphQL coercing methods to include additional parametersMake `levelNumberToCommonsLevelName` method staticReplace deprecated
newInstancewithgetDeclaredConstructor().newInstanceReplace deprecated
newInstancewithgetDeclaredConstructor().newInstanceUse `Duration.ofSeconds` for timeout in `SlowLoadableComponent`Use `Duration.ofSeconds` for timeout in `SlowLoadableComponent`6 files
Replace `initMocks` with `openMocks` in test setupReplace `initMocks` with `openMocks` in test setupReplace `initMocks` with `openMocks` in test setupReplace `initMocks` with `openMocks` in test setupReplace `initMocks` with `openMocks` in test setupImprove type safety in assertions using `InstanceOfAssertFactories`