Skip to content

Fix build warnings in jnienv-gen project#11977

Open
simonrozsival wants to merge 1 commit into
mainfrom
dev/simonrozsival/fix-jnienv-gen-build-warnings
Open

Fix build warnings in jnienv-gen project#11977
simonrozsival wants to merge 1 commit into
mainfrom
dev/simonrozsival/fix-jnienv-gen-build-warnings

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Jul 4, 2026

Copy link
Copy Markdown
Member

This change removes the following build warning:

jnienv-gen net10.0 succeeded with 1 warning(s) (3.1s) → bin/BuildDebug/jnienv-gen.dll
    /.../build-tools/jnienv-gen/Generator.cs(524,15): warning CS0649: Field 'JniFunction.Prebind' is never assigned to, and will always have its default value false

Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

Copilot AI review requested due to automatic review settings July 4, 2026 07:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes a previously grandfathered warning exemption for the jnienv-gen project by eliminating the underlying unused Prebind field and its associated dead code paths in the generator, so the project can build cleanly with warnings treated as errors on CI.

Changes:

  • Remove the jnienv-gen.csproj carve-out from _AllowProjectWarnings, allowing CI’s TreatWarningsAsErrors behavior to apply.
  • Delete the unused JniFunction.Prebind field and simplify GenerateJniNativeInterfaceInvoker to always emit the lazy-initialization property form.
Show a summary per file
File Description
Directory.Build.props Removes the jnienv-gen warning allowance so CI treats warnings as errors for the project.
build-tools/jnienv-gen/Generator.cs Removes the unused Prebind flag and simplifies generated invoker delegate binding code accordingly.

Copilot's findings

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

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 4, 2026
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, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants