Repository navigation
Avoid warning when dynamic attach is enabled - #3551
Merged
Merged
Conversation
…bled. Add information in readme.
# Conflicts: # mockito-core/src/main/java/org/mockito/internal/PremainAttachAccess.java
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3551 +/- ##
============================================
- Coverage 85.60% 85.55% -0.05%
- Complexity 2954 2955 +1
============================================
Files 341 341
Lines 8976 8995 +19
Branches 1118 1119 +1
============================================
+ Hits 7684 7696 +12
- Misses 1003 1009 +6
- Partials 289 290 +1 ☔ View full report in Codecov by Sentry. |
…ilable due to use of modules, or when running on Android.
…ilable due to use of modules, or when running on Android.
TimvdLippe
reviewed
Dec 17, 2024
bric3
approved these changes
Dec 17, 2024
This was referenced Jan 3, 2025
|
This doesn't work for me. That's because results in a and therefore in But it works, when getInputArguments is requested without Reflection: |
Member
Author
|
Indeed, this is an annoying implication of the module system if a method is resolved against an overriding class, not the interface. I will need to change that to get the interface class and to invoke the method on it. |
Member
Author
|
Suggested fix: #3566 |
TimvdLippe
pushed a commit
that referenced
this pull request
Jan 6, 2025
Use interface type for invoking method to avoid that module boundaries are breached when using reflection on internal implementation type. Relates to #3551
This was referenced Mar 3, 2025
svc-squareup-copybara
pushed a commit
to cashapp/misk
that referenced
this pull request
Mar 4, 2025
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://github.com/mockito/mockito) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `5.15.2` -> `5.16.0` | | [io.grpc:grpc-stub](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-protobuf](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-netty](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:protoc-gen-grpc-java](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-bom](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-api](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [com.google.apis:google-api-services-storage](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `v1-rev20241206-2.0.0` -> `v1-rev20250224-2.0.0` | | [com.fasterxml.jackson.module:jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.datatype:jackson-datatype-jsr310](https://github.com/FasterXML/jackson-modules-java8) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.dataformat:jackson-dataformat-yaml](https://github.com/FasterXML/jackson-dataformats-text) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) ([source](https://github.com/FasterXML/jackson-databind)) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.core:jackson-core](https://github.com/FasterXML/jackson-core) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.core:jackson-annotations](https://github.com/FasterXML/jackson) ([source](https://github.com/FasterXML/jackson-annotations)) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | --- ### Release Notes <details> <summary>mockito/mockito (org.mockito:mockito-core)</summary> ### [`v5.16.0`](https://github.com/mockito/mockito/releases/tag/v5.16.0) <sup><sup>*Changelog generated by [Shipkit Changelog Gradle Plugin](https://github.com/shipkit/shipkit-changelog)*</sup></sup> ##### 5.16.0 - 2025-03-03 - [10 commit(s)](mockito/mockito@v5.15.2...v5.16.0) by Brice Dutheil, Rafael Winterhalter, TDL, dependabot\[bot] - Add support for including module-info in Mockito. [(#​3597)](mockito/mockito#3597) - Bump com.gradle.develocity from 3.19 to 3.19.1 [(#​3579)](mockito/mockito#3579) - Bump org.assertj:assertj-core from 3.27.2 to 3.27.3 [(#​3577)](mockito/mockito#3577) - Bump com.diffplug.spotless:spotless-plugin-gradle from 7.0.1 to 7.0.2 [(#​3574)](mockito/mockito#3574) - Bump com.diffplug.spotless:spotless-plugin-gradle from 6.25.0 to 7.0.1 [(#​3571)](mockito/mockito#3571) - Bump org.assertj:assertj-core from 3.27.1 to 3.27.2 [(#​3569)](mockito/mockito#3569) - Tweaks documentation on mockito agent config for maven [(#​3568)](mockito/mockito#3568) - Adds `--info` to diagnose closeAndReleaseStagingRepositories issues [(#​3567)](mockito/mockito#3567) - Refine reflection when calling management factory [(#​3566)](mockito/mockito#3566) - Avoid warning when dynamic attach is enabled [(#​3551)](mockito/mockito#3551) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am every weekday" in timezone Australia/Melbourne, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). GitOrigin-RevId: b36ad622d93f38a65018855e51bd093a591e512b
eizus
pushed a commit
to cdrxyz/misk
that referenced
this pull request
Jul 18, 2026
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://github.com/mockito/mockito) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `5.15.2` -> `5.16.0` | | [io.grpc:grpc-stub](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-protobuf](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-netty](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:protoc-gen-grpc-java](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-bom](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [io.grpc:grpc-api](https://github.com/grpc/grpc-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.70.0` -> `1.71.0` | | [com.google.apis:google-api-services-storage](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `v1-rev20241206-2.0.0` -> `v1-rev20250224-2.0.0` | | [com.fasterxml.jackson.module:jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.datatype:jackson-datatype-jsr310](https://github.com/FasterXML/jackson-modules-java8) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.dataformat:jackson-dataformat-yaml](https://github.com/FasterXML/jackson-dataformats-text) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) ([source](https://github.com/FasterXML/jackson-databind)) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.core:jackson-core](https://github.com/FasterXML/jackson-core) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [com.fasterxml.jackson.core:jackson-annotations](https://github.com/FasterXML/jackson) ([source](https://github.com/FasterXML/jackson-annotations)) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.18.2` -> `2.18.3` | | [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | | [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.30` -> `2.30.32` | --- ### Release Notes <details> <summary>mockito/mockito (org.mockito:mockito-core)</summary> ### [`v5.16.0`](https://github.com/mockito/mockito/releases/tag/v5.16.0) <sup><sup>*Changelog generated by [Shipkit Changelog Gradle Plugin](https://github.com/shipkit/shipkit-changelog)*</sup></sup> ##### 5.16.0 - 2025-03-03 - [10 commit(s)](mockito/mockito@v5.15.2...v5.16.0) by Brice Dutheil, Rafael Winterhalter, TDL, dependabot\[bot] - Add support for including module-info in Mockito. [(#​3597)](mockito/mockito#3597) - Bump com.gradle.develocity from 3.19 to 3.19.1 [(#​3579)](mockito/mockito#3579) - Bump org.assertj:assertj-core from 3.27.2 to 3.27.3 [(#​3577)](mockito/mockito#3577) - Bump com.diffplug.spotless:spotless-plugin-gradle from 7.0.1 to 7.0.2 [(#​3574)](mockito/mockito#3574) - Bump com.diffplug.spotless:spotless-plugin-gradle from 6.25.0 to 7.0.1 [(#​3571)](mockito/mockito#3571) - Bump org.assertj:assertj-core from 3.27.1 to 3.27.2 [(#​3569)](mockito/mockito#3569) - Tweaks documentation on mockito agent config for maven [(#​3568)](mockito/mockito#3568) - Adds `--info` to diagnose closeAndReleaseStagingRepositories issues [(#​3567)](mockito/mockito#3567) - Refine reflection when calling management factory [(#​3566)](mockito/mockito#3566) - Avoid warning when dynamic attach is enabled [(#​3551)](mockito/mockito#3551) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am every weekday" in timezone Australia/Melbourne, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). GitOrigin-RevId: b36ad622d93f38a65018855e51bd093a591e512b
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checks the command line arguments for the
EnableDynamicAgentLoadingargument and does not warn about dynamic attach, if the option is set.