[generator] Investigate Throwable constructor-chain and partial-hook lifecycle coverage
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- devtools, testing-qa
Hướng nghiên cứu
Start with PeerConstructorPartialMethod_Class in CodeGeneratorTests.cs, then trace forwarding and initializer selection in BoundClass.cs and BoundConstructor.cs; compare the Streams IOException snapshot. Run the generator tests, then investigate a two-level Throwable hierarchy on a real Android/JNI runtime. Done means focused output and lifecycle coverage distinguishes hook count/order and peer validity without treating compile-only probes as native coverage.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Android framework version
net11.0-android (Preview) — generator and runtime coverage follow-up; also distinguish legacy compilation from updated memory-safety-rules probes.
Affected platform version
Binding-constructor preparation reviewed in #13190 at commit e4473175aba5271fd839d0a1dd8b3777a8ca5f90. This is a coverage gap, not an observed runtime regression.
Description
Follow-up to https://github.com/dotnet/android/pull/13190#discussion_r4415013169.
Investigate and improve coverage of generated Throwable construction through the internal JniObjectReferenceOptions.None forwarding route, especially with inheritance and peerConstructorPartialMethod hooks.
The existing PeerConstructorPartialMethod_Class test checks emitted text for an ordinary Object-derived class. The Streams IOException snapshot has a forwarding declaration but no bound Java constructors or partial hooks. Earlier session-only generated-chain/compiler probes covered constructor selection and implementation/reference accessibility, not actual hook execution order or real Java-peer creation. Passing compiler probes must not be presented as native lifecycle coverage.
A focused follow-up should investigate a two-level generated Throwable inheritance chain with bound Java constructors and hooks, then add appropriately scoped coverage for:
- Ordinary managed constructors selecting the
Noneforwarding route. - Hooks running exactly once, in base-to-derived order, before a Java peer is installed.
- Normal construction subsequently yielding a valid Java peer.
- Existing initialization, dispatch and cleanup behavior remaining intact.
Separate generator-output assertions from actual Android/JNI lifecycle tests; a synthetic handle or compile-only peer model does not prove a valid native peer.
The originating PR is an unsafe audit, not a general refactoring or test-coverage expansion. No behavioral bug has been demonstrated here, and the user explicitly requested tracking this improvement separately. This issue is also distinct from the known cross-assembly updated-rules constructor-initializer limitation: internal forwarding does not provide external assemblies with an accessible safe base constructor, and the corresponding CS9362 probe remains an unresolved design boundary, not a runtime failure reproduced by this issue.
Relevant source:
external/Java.Interop/tools/generator/SourceWriters/BoundClass.cs: forwarding constructor and partial hook emission.external/Java.Interop/tools/generator/SourceWriters/BoundConstructor.cs: initializer selection and JNI peer construction.external/Java.Interop/tests/generator-Tests/Unit-Tests/CodeGeneratorTests.cs:PeerConstructorPartialMethod_Class.external/Java.Interop/tests/generator-Tests/expected.xaji/Streams/Java.IO.IOException.cs.external/Java.Interop/Documentation/Architecture.md: generated managed binding safety and cross-assembly limitation.
Steps to Reproduce
- Inspect the existing hook test and Streams
IOExceptionfixture to confirm the missing combined inheritance/constructor/hook case. - Generate a two-level Throwable subclass chain containing bound Java constructors and distinct partial construction hooks.
- Check initializer selection and hook emission in actual generated output.
- Run the generated hierarchy against a real Android/JNI runtime, recording hook count/order and peer state before and after construction.
- Document findings and add focused regression/coverage tests appropriate to any behavior demonstrated. Do not silently change constructor accessibility, public API, caller contracts or language settings to make the tests pass.
Did you find any workaround?
N/A. No runtime failure or workaround has been established; the current gap is missing focused behavioral coverage.
Relevant log output
N/A. No failing lifecycle trace is available. Existing compile/accessibility evidence does not establish hook execution or native peer validity.
- Ngôn ngữ chính
- C#
- Star
- 2.1k
- Fork
- 579
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 258
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dotnet/android
-
Area: App+Library Build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
EditText.getText() isn't boundĐang mởArea: Mono.Android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dotnet/android#9192 · 4 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[generator] Investigate deferred-constructor capability scanning with shallow reference importsĐang mởneeds-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
dotnet/android#13325 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area: CoreCLR Area: Debugger bug needs-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 24/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của dotnet/android
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
possible bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Include host.wslc.internal in the HTTPS development certificateCó thể đã có người làm @afscrome đã nhận hôm nay. Đang mởarea-commandlinetools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
dotnet/aspnetcore#70122 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
:1st_place_medal: good first issue :cowboy_hat_face: refactor :roller_coaster: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ApplETS/Backend-Hello#78 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày