-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Avoid warning when dynamic attach is enabled #3551
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.
mockito-core/src/main/java/org/mockito/internal/PremainAttachAccess.java
Show resolved
Hide resolved
mockito-core/src/main/java/org/mockito/internal/PremainAttachAccess.java
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.
Nice!
This doesn't work for me. That's because mockito/mockito-core/src/main/java/org/mockito/internal/PremainAttachAccess.java Lines 50 to 55 in e04dbbe
results in a
and therefore in But it works, when getInputArguments is requested without Reflection:
|
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. |
Suggested fix: #3566 |
Use interface type for invoking method to avoid that module boundaries are breached when using reflection on internal implementation type. Relates to #3551
Checks the command line arguments for the
EnableDynamicAgentLoading
argument and does not warn about dynamic attach, if the option is set.