Skip to content

Conversation

@duanemay
Copy link
Member

@duanemay duanemay commented Oct 3, 2025

Starting from Java 21, the JDK restricts the ability of libraries to attach a Java agent to their own JVM. As a result, the inline-mock-maker might not be able to function without an explicit setup to enable instrumentation, and the JVM will always display a warning.

https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3

Starting from Java 21, the JDK restricts the ability of libraries to attach a Java agent to their own JVM. As a result, the inline-mock-maker might not be able to function without an explicit setup to enable instrumentation, and the JVM will always display a warning.

https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds explicit instrumentation setup for inline mocking to address Java 21 JDK restrictions on agent attachment. Starting from Java 21, libraries can no longer attach Java agents to their own JVM without explicit configuration, which causes the inline-mock-maker to fail and display warnings.

  • Adds mockito-core dependency to enable proper instrumentation setup
  • Addresses compatibility issues with Java 21's agent attachment restrictions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@duanemay duanemay requested review from fhanik and strehle October 7, 2025 17:23
@strehle strehle requested a review from Copilot October 8, 2025 05:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-project-automation github-project-automation bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Oct 8, 2025
@duanemay duanemay merged commit 515c8cf into develop Oct 8, 2025
27 checks passed
@duanemay duanemay deleted the mockito-instrumentation branch October 8, 2025 14:16
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants