Skip to content

Remove Java.Interop.Dynamic#1449

Open
simonrozsival wants to merge 3 commits into
mainfrom
dev/simonrozsival/remove-java-interop-dynamic
Open

Remove Java.Interop.Dynamic#1449
simonrozsival wants to merge 3 commits into
mainfrom
dev/simonrozsival/remove-java-interop-dynamic

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Part of #1448.

This removes the standalone C# dynamic JNI provider and its dedicated tests. It also removes the Dynamic test entry from the core CI template and updates docs/agent metadata that referenced the deleted component.

Validation:

  • SDKROOT=$(xcrun --sdk macosx --show-sdk-path) dotnet test tests/Java.Interop-Tests/Java.Interop-Tests.csproj
    • Passed: 671, Failed: 0, Skipped: 4

Remove the standalone C# dynamic JNI provider and its dedicated tests from the solution and CI template. Update docs that referenced the removed component.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 05:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Removes the legacy Java.Interop.Dynamic C# dynamic JNI provider and its dedicated test suite as part of repository reduction work for dotnet/android (issue #1448), and cleans up CI/docs references to the removed component.

Changes:

  • Deleted the src/Java.Interop.Dynamic project and all of its source files.
  • Deleted the tests/Java.Interop.Dynamic-Tests test project and removed it from the solution/CI.
  • Updated documentation and GitHub agent metadata to remove references to the deleted component.
Show a summary per file
File Description
tests/Java.Interop.Dynamic-Tests/Java.Interop/JavaVMFixture.cs Removes dynamic test JVM fixture.
tests/Java.Interop.Dynamic-Tests/Java.Interop/DynamicJavaInstanceTests.cs Removes DynamicJavaInstance test coverage (project deleted).
tests/Java.Interop.Dynamic-Tests/Java.Interop/DynamicJavaClassTests.cs Removes DynamicJavaClass test coverage (project deleted).
tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj Removes the Dynamic test project definition and references.
tests/invocation-overhead/README.md Removes a mention of Java.Interop.Dynamic-related commits.
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JniMetaObject.cs Deletes dynamic metaobject implementation (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodInfo.cs Deletes dynamic invocation method wrapper (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodBase.cs Deletes dynamic invocation base type (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMemberInfo.cs Deletes dynamic member info abstraction (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaInstanceProxy.cs Deletes proxy type used for dynamic instance creation (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaFieldInfo.cs Deletes dynamic field wrapper (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaConstructorInfo.cs Deletes dynamic constructor wrapper (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaClassInfo.cs Deletes reflection-based class info cache for dynamic binding (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaInstance.cs Deletes public dynamic instance API (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaClass.cs Deletes public dynamic class API (project deleted).
src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj Removes the Dynamic library project definition.
Java.Interop.sln Removes Dynamic library + Dynamic tests from the solution and build configurations.
Documentation/BuildConfiguration.md Updates example to reference remaining core test assembly.
Documentation/Architecture.md Removes Architecture.md references/links to Java.Interop.Dynamic.
build-tools/automation/templates/core-tests.yaml Removes Dynamic test run from CI template.
.github/skills/build-and-test/SKILL.md Removes Dynamic tests from the “common test projects” list.
.github/copilot-instructions.md Removes Dynamic component from repo structure list.

Copilot's findings

  • Files reviewed: 22/22 changed files
  • Comments generated: 0

@simonrozsival

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

…ove-java-interop-dynamic

# Conflicts:
#	tests/invocation-overhead/README.md

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Done — I resolved the merge conflict and merged main into this branch in commit 9943676d.

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, thanks! label Jun 9, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Java.Interop PR Reviewer completed successfully!

@simonrozsival

Copy link
Copy Markdown
Member Author

@copilot address the reviewer's comments:

◆ Found it. The `Makefile` has two remaining references to `Java.Interop.Dynamic`:
  1. Line 25: `bin/Test$(CONFIGURATION)/Java.Interop.Dynamic-Tests.dll \`
  2. Line 98: `$(eval $(call TestAssemblyTemplate,Java.Interop.Dynamic))`
  
  These should have been removed as part of this PR. Let me check if there's anything else that references the deleted component.
  
  Let me also check if there are any remaining references in any other files.

✓ $ cd /home/runner/work/java-interop/java-interop && grep -rn "Java.Interop.Dynamic" . --exclude-dir=.git --exclude-dir=src/Java.Interop.Dynamic --exclude-dir=tests/Java.Interop.Dynamic-Tests 2>/dev/null

◆ Good - the only remaining references are in the `Makefile`. The `src/Java.Interop.Dynamic` and `tests/Java.Interop.Dynamic-Tests` directories are being deleted by this PR, but the Makefile is not updated. This is a clear miss.
  
  Now let me also look at the Architecture.md changes more carefully. The rewrite removes the paragraph about the C# 4 `dynamic` provider and rewrites it. Let me verify the new text makes sense.
  
  Let me now prepare my review. The main findings:
  
  1. **Bug/Missing change (⚠️ warning):** The `Makefile` still references `Java.Interop.Dynamic` in two places (lines 25 and 98), which will cause build failures when running `make run-tests` since the deleted test DLL won't exist.
  2. **Fix for pre-existing issue (💡 suggestion):** The added `EndProject` line in the .sln file fixes a pre-existing bug - worth noting as a good catch.
  3. The remaining changes look solid - documentation updates are accurate, CI template is properly updated, and the solution file has all references properly cleaned up. Let me verify the Architecture.md rewrite is coherent and makes sense in context.
  
  The original passage discussed a long-standing desire to provide a C# `dynamic` provider for Java method invocation, which would leverage the `IDynamicMetaObjectProvider` interface and `System.Linq.Expressions` for runtime IL generation. The rewrite simplifies this to focus directly on embracing `System.Linq.Expressions` for its runtime IL generation capabilities, removing the intermediate discussion of the `dynamic` provider pattern itself.

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@copilot address the reviewer's comments:

◆ Found it. The `Makefile` has two remaining references to `Java.Interop.Dynamic`:

...

Fixed in ca6f164: removed both stale Java.Interop.Dynamic references from Makefile (the TESTS entry and TestAssemblyTemplate eval).

@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Java.Interop PR Reviewer completed successfully!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ LGTM — Clean removal

This is a thorough and well-executed removal of Java.Interop.Dynamic. All references across the solution file, Makefile, CI templates, documentation, and agent metadata have been cleaned up. The grep for Java\.Interop\.Dynamic across the entire repo returns zero hits — nothing was missed.

Checklist

Area Status
Solution file ✅ Project entries, build configs, and nesting entries removed
Makefile ✅ Test DLL and TestAssemblyTemplate call removed
CI pipeline (core-tests.yaml) ✅ Dynamic test step removed
Documentation ✅ Architecture.md, BuildConfiguration.md, copilot-instructions.md updated
Agent metadata (SKILL.md) ✅ Dynamic-Tests entry removed

Minor follow-ups (not blocking)

  1. Stale dynamic reference in Architecture.md line 163 — The text still lists "C# 4 dynamic" as a use case for the centralized marshaling infrastructure. See inline comment.

  2. Dead code: JniPeerMembers.CreatePeerMembers — The static CreatePeerMembers() method at src/Java.Interop/Java.Interop/JniPeerMembers.cs:68 was only invoked via reflection from the now-deleted JavaClassInfo.cs. It's now unreferenced dead code. Consider removing it as a follow-up (possibly in the parent issue #1448).

Positive callouts

  • Bonus fix of the missing EndProject line for Maven-Tests in the .sln file — good to catch.
  • Documentation rewrite in Architecture.md preserves the logical flow without the dynamic provider motivation.

Generated by Java.Interop PR Reviewer for issue #1449 · ● 5.4M

Comment thread Documentation/Architecture.md
Comment thread Java.Interop.sln
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, thanks!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants