-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[java] Replacing some deprecated methods #15443
base: trunk
Are you sure you want to change the base?
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:
|
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
newInstance
withgetDeclaredConstructor().newInstance
for reflection-based object creation.Updated
SlowLoadableComponent
constructors to useDuration.ofSeconds
for timeout values.Migrated from
MockitoAnnotations.initMocks
toMockitoAnnotations.openMocks
in test setup methods.Improved type safety in assertions using
InstanceOfAssertFactories
in tests.Changes walkthrough 📝
7 files
Replace deprecated
newInstance
withgetDeclaredConstructor().newInstance
Update GraphQL coercing methods to include additional parameters
Make `levelNumberToCommonsLevelName` method static
Replace deprecated
newInstance
withgetDeclaredConstructor().newInstance
Replace deprecated
newInstance
withgetDeclaredConstructor().newInstance
Use `Duration.ofSeconds` for timeout in `SlowLoadableComponent`
Use `Duration.ofSeconds` for timeout in `SlowLoadableComponent`
6 files
Replace `initMocks` with `openMocks` in test setup
Replace `initMocks` with `openMocks` in test setup
Replace `initMocks` with `openMocks` in test setup
Replace `initMocks` with `openMocks` in test setup
Replace `initMocks` with `openMocks` in test setup
Improve type safety in assertions using `InstanceOfAssertFactories`