Skip to content

[Java.Interop] Remove unused parameter-name importer - #13113

Merged
simonrozsival merged 3 commits into
mainfrom
simonrozsival-sgmlreader-usage
Oct 13, 2026
Merged

simonrozsival merged 3 commits into
mainfrom
simonrozsival-sgmlreader-usage

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

param-name-importer was deliberately replaced in the Android API-generation workflow on September 12, 2025, in #10438, commit 35d471e. Its source, build references, dependency, and stale documentation remained after the replacement.

Historical use and replacement

The importer was an API-maintenance tool: maintainers used it to extract Java method parameter names from DroidDoc HTML or Android SDK android-stubs-src.jar files, then checked the resulting api-*.params.txt files into src/Mono.Android/Profiles/. class-parse still consumes those files; this change does not remove or change them.

  • January 19, 2020: dotnet/java-interop#560 integrated the older xamarin-android-docimporter-ng utility under the name param-name-importer.
  • March 2021: #5653 documented running the importer manually when adding an Android API level and copying its generated parameter file into the repository.
  • May 22, 2024: #8948, commit c993dee, added the GenerateParamsFile target, which invoked param-name-importer.dll explicitly.
  • September 12, 2025: #10438 replaced that invocation with java-source-utils.jar.

The replacement was necessary because the importer's Irony-based Java parser could not parse API-CANARY's java/lang/Character.java, reporting:

Error (3050:47) Invalid character: '''.

The replacement PR explicitly explains that java-source-utils.jar has a better Java parser and can already emit the same parameter-name text format. Its diff removes the importer invocation and replaces it with java -jar java-source-utils.jar --output-params ....

Immediately after that replacement, the Android repository's only remaining references outside the then-Java.Interop submodule were the project reference and documentation saying to build the tool. No subsequent invocation was restored in the current history. The old standalone generation script remained inside Java.Interop; this change retires that legacy/manual route as well.

Changes

  • Remove the importer project, C# sources, legacy generation script, HTML DTD/entity resources, and tool-specific documentation.
  • Remove its Android project reference and Java.Interop solution entry.
  • Remove the Microsoft.Xml.SgmlReader package pin, SgmlReaderDll.dll signing entry, and SgmlReader third-party notice; renumber the remaining notice entries.
  • Update the API-level workflow documentation and repository dependency/tool inventories.

The active GenerateParamsFile, _ClassParse, and GenerateApiDescription targets are unchanged. Shared JavaSource/parser libraries and their tests remain. No tracked importer or SgmlReader references remain, and restored dependency graphs no longer contain Microsoft.Xml.SgmlReader.

Local validation

Command Result
dotnet build build-tools/create-android-api/create-android-api.csproj -v minimal Passed; zero warnings/errors.
dotnet build external/Java.Interop/Java.Interop.slnx -v minimal Passed; zero warnings/errors.
dotnet build external/Java.Interop/tools/java-source-utils/java-source-utils.csproj -t:RunTests -v minimal Passed; 18 Java tests, none skipped. Six obsolete Java source/target-version warnings.
dotnet test external/Java.Interop/tests/Java.Interop.Tools.JavaSource-Tests/Java.Interop.Tools.JavaSource-Tests.csproj -v minimal Passed; 41 tests, none skipped.
dotnet test external/Java.Interop/tests/Xamarin.Android.Tools.Bytecode-Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj --no-build -v minimal --filter 'FullyQualifiedName~ParameterFixupTests|FullyQualifiedName~KotlinFixupsTests' Passed; 28 tests, two DroidDoc/documentation cases skipped.
./dotnet-local.sh build build-tools/create-android-api/create-android-api.csproj -t:GenerateParamsFile -p:ParamApiLevel=36 -v minimal Passed; generated 287 packages, 6,222 types, and 34,573 members. Output matches the earlier validation run. Validation-generated profile changes were reversed; checked-in profiles remain unchanged.
git diff --check Passed.
make prepare && make all Prepare and full solution compilation passed. The subsequent ConfigureLocalWorkload phase failed because bin/Debug/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/37.1/ref/Mono.Android.dll was missing. Confirmed by replaying the workload-setup binlog; no unrelated workload changes made.
dotnet test external/Java.Interop/tests/Xamarin.Android.Tools.Bytecode-Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj -v minimal Broader suite: 97 passed, two skipped, one failed. ModuleInfoTests.ClassFile expected 12 constant-pool entries; its generated fixture contained 13. The test, fixture source, compiler target, and bytecode library are unchanged by this PR.

Changed XML parses successfully. The remaining notice sections are preserved and the TOC is consecutively numbered. No issue is being closed, and no new tests are added for the deleted utility.


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

Context: #10438
Context: dotnet/java-interop#560

param-name-importer generated checked-in Java parameter descriptions
when maintainers added Android API levels.  Java.Interop integrated the
older xamarin-android-docimporter-ng tool under this name in January
2020.  Android added an explicit GenerateParamsFile invocation in May
2024, in #8948.

On September 12, 2025, #10438 replaced that invocation with
java-source-utils.jar.  The Irony-based importer failed to parse
API-CANARY java/lang/Character.java, reporting an invalid apostrophe.
The Java replacement already supported the same parameter-name text
format.  The project reference, standalone utility, and stale build
documentation remained after the switch.

Remove the legacy utility and HTML resources, retained build and
solution references, SgmlReader package pin, signing entry, and notice.
Update related documentation.  Keep the active Java generator, shared
parser libraries, checked-in parameter files, and their consumers.

The API-generation project and Java.Interop solution build.  Active
Java generator, JavaSource, and focused parameter tests pass; API 36
parameter generation succeeds.  The full solution compiles, but local
workload setup fails on a missing API 37.1 Mono.Android.dll.  The wider
bytecode suite also reports an unchanged module-info fixture mismatch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 10:15

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.

🟡 Changes recommended

The third-party notice TOC omits the existing Kajabity license section and must be corrected before merge.

1 open finding
What changed in this PR

Removes the obsolete param-name-importer after parameter generation moved to java-source-utils.

Changes:

  • Deletes the importer implementation, resources, script, and documentation.
  • Removes obsolete build, solution, signing, and package references.
  • Updates workflow documentation and third-party notices.
File Description
THIRD-PARTY-NOTICES.TXT Removes SgmlReader notice and renumbers entries.
external/​Java.Interop/​tools/​param-name-importer/​strict.dtd Deletes obsolete HTML DTD.
external/​Java.Interop/​tools/​param-name-importer/​README.md Deletes importer documentation.
external/​Java.Interop/​tools/​param-name-importer/​Program.cs Deletes importer entry point.
external/​Java.Interop/​tools/​param-name-importer/​param-name-importer.csproj Deletes the tool project.
external/​Java.Interop/​tools/​param-name-importer/​JavaStubSourceImporter.cs Deletes Java-stub importer.
external/​Java.Interop/​tools/​param-name-importer/​JavaApiParameterNamesExporter.cs Deletes legacy exporters.
external/​Java.Interop/​tools/​param-name-importer/​ImporterOptions.cs Deletes importer options.
external/​Java.Interop/​tools/​param-name-importer/​HTMLsymbol.ent Deletes HTML symbol entities.
external/​Java.Interop/​tools/​param-name-importer/​HTMLspecial.ent Deletes HTML special entities.
external/​Java.Interop/​tools/​param-name-importer/​HtmlLoader.cs Deletes SGML-based HTML loader.
external/​Java.Interop/​tools/​param-name-importer/​HTMLlat1.ent Deletes Latin-1 entities.
external/​Java.Interop/​tools/​param-name-importer/​generate.sh Deletes legacy generation script.
external/​Java.Interop/​tools/​param-name-importer/​DroidDocImporter.cs Deletes DroidDoc importer.
external/​Java.Interop/​tools/​param-name-importer/​DealingWithJavaApiDescription.md Deletes stale parser documentation.
external/​Java.Interop/​Java.Interop.slnx Removes importer project entry.
external/​Java.Interop/​Directory.Build.targets Removes SgmlReader package version.
Documentation/​workflow/​HowToAddNewApiLevel.md Documents java-source-utils usage.
build-tools/​create-packs/​SignList.xml Removes SgmlReader signing entry.
build-tools/​create-android-api/​create-android-api.csproj Removes importer project reference.
.github/​skills/​update-tpn/​SKILL.md Removes SgmlReader inventory entry.
.github/​instructions/​java-interop.instructions.md Removes importer from tool inventory.

🧠 Review effort: Balanced

Comment thread THIRD-PARTY-NOTICES.TXT Outdated
@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Oct 13, 2026
Preserve upstream CRC32.NET removal and this PR's SgmlReader removal,
then renumber the surviving notice entries.  Retain all upstream
Java.Interop changes, including removal of native support sources.

The API-generation project and Java.Interop solution build successfully.
JavaSource tests pass (41 tests), and the current Java parameter generator
RunTests target succeeds with its existing 18-test results up to date.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@simonrozsival

Copy link
Copy Markdown
Member Author

@dalexsoto stamp

@simonrozsival

Copy link
Copy Markdown
Member Author

@dalexsoto stamp

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stamping as requested by @simonrozsival; no code review performed.

@simonrozsival
simonrozsival merged commit 8b8eac8 into main Oct 13, 2026
41 checks passed
@simonrozsival
simonrozsival deleted the simonrozsival-sgmlreader-usage branch October 13, 2026 19:54
jonathanpeppers added a commit that referenced this pull request Oct 13, 2026
Fixes #13117. Follow-up to #13113.

## Changes

Replace the vendored Kajabity reader with a compact, in-tree Java-properties helper and migrate the SDK/JDK installer consumers to dictionaries. Preserve Latin-1 decoding, escaped keys/values, continuations, duplicate-key handling, and legacy quirks such as permissive Unicode digits and trailing-backslash behavior.

Remove all four Kajabity types, their third-party notice, the stale Guardian/analysis suppressions, and the now-unused `System.Text.Encoding.CodePages` package/version property. Add parsing and SDK/JDK discovery regression tests.

`AndroidUtilities.ReadAndroidProperties()` now returns `Dictionary<string, string>` instead of the removed third-party type. Malformed escapes retain the logged, resource-backed `InvalidOperationException` wrapper, with `FormatException` replacing the deleted custom inner exception.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

5 participants