diff --git a/JAVA_MIGRATION.md b/JAVA_MIGRATION.md index ac15205..b21414e 100644 --- a/JAVA_MIGRATION.md +++ b/JAVA_MIGRATION.md @@ -812,3 +812,11 @@ generated-trait compatibility work. Scala-runtime removal remains a later projec unchanged; only the actual client rendering remains manual. - All 177 plain-JVM and all 92 Java 8 Forge dedicated-server tests pass. This inert singleton is not a meaningful focused performance target; `DefaultContent.scala` is the next medium-risk target. +- Characterized `DefaultContent` against untouched Scala. One plain-JVM case freezes its one-method static and + companion surfaces. Two Forge cases freeze the five microblock factories and IDs, all 103 sorted built-in + materials, their exact implementation types and the complete legacy-name remap table. +- Ported the singleton to a Java facade/companion pair while continuing to use the existing `BlockMicroMaterial$` + overloads and Scala ranges. Registration contents, ordering and the historical meta-0-only `log2`/`leaves2` + overload behavior are unchanged. +- All 178 plain-JVM and all 94 Java 8 Forge dedicated-server tests pass. Pre-init-only registration is not a meaningful + focused performance target; `GrassMicroMaterial.scala` is the next material unit. diff --git a/JAVA_MIGRATION_DIVERGENCES.md b/JAVA_MIGRATION_DIVERGENCES.md index c7e6b45..71d4e30 100644 --- a/JAVA_MIGRATION_DIVERGENCES.md +++ b/JAVA_MIGRATION_DIVERGENCES.md @@ -2080,3 +2080,39 @@ use `MissingMicroMaterial$.MODULE$`; static calls retain their original names an - Java 8 Forge dedicated-server suite: 92 tests, 0 failures, 0 errors. - Raw `javap` comparison confirms identical callable public names/descriptors and the emitted class list is unchanged. - Missing-texture icon loading and face rendering require a client and remain on the manual checklist. + +## 2026-08-31 — DefaultContent Java port + +The built-in microblock registration singleton is now a Java static facade plus Java companion. `MicroblockMod$` +continues to call `DefaultContent$.MODULE$.load()` during pre-init. + +### Observable behavior + +No known runtime divergence. The same face, hollow, corner and edge classes retain IDs 0 through 3, and the post +class remains registered without a common-class ID. Their five multipart type names and exact singleton factories are +unchanged. + +The material registry still receives the same 103 entries, sorts them by name during post-init, and maps every legacy +unlocalized key to the same registry key. Grass still uses `GrassMicroMaterial`, mycelium still uses +`TopMicroMaterial`, and the missing key still maps to `MissingMicroMaterial$.MODULE$`. The Java implementation calls +the existing `BlockMicroMaterial$` overloads with Scala inclusive ranges, preserving the reference's meta coverage. +In particular, the three-argument overload used for `log2` and `leaves2` still registers only metadata zero despite +receiving ranges through one; this port deliberately does not combine a behavior fix with the language conversion. + +### ABI and source compatibility + +`DefaultContent` retains its sole public static `load()V`; `DefaultContent$` retains `MODULE$` and the matching public +instance method. Both jars emit exactly `DefaultContent.class` and `DefaultContent$.class`. No audited shipping +consumer references either type. + +Accepted classfile-only differences are removed Scala signature/marker attributes, a private constructor on the +facade, and a class initializer without Scala's `ACC_PUBLIC` flag. A class initializer is JVM-only and is not a +callable member. + +### Validation + +- `DefaultContentCharacterizationTest`: 1 plain-JVM test, unchanged from the Scala baseline. +- `DefaultContentFunctionalTest`: 2 Forge tests, unchanged from the Scala baseline. +- Complete plain-JVM suite: 178 tests, 0 failures, 0 errors. +- Java 8 Forge dedicated-server suite: 94 tests, 0 failures, 0 errors. +- Raw `javap` comparison confirms identical callable public names/descriptors and the emitted class list is unchanged. diff --git a/JAVA_MIGRATION_HANDOFF.md b/JAVA_MIGRATION_HANDOFF.md index 3bf9c7a..1b1d623 100644 --- a/JAVA_MIGRATION_HANDOFF.md +++ b/JAVA_MIGRATION_HANDOFF.md @@ -12,8 +12,8 @@ what breaks, and what is left. The other documents hold the reasoning. | `JAVA_MIGRATION_MANUAL_CHECKS.md` | What no automated test can cover, and must be checked by hand in a client | | `JAVA_MIGRATION_PROFILE.md` | The focused baseline, first measured result, findings, and exact rerun command | -Branch: `algent/java`. Base: `master`. 102 commits including the incremental-version build fix and separate -characterization and port commits for `MissingMicroMaterial`. +Branch: `algent/java`. Base: `master`. 104 commits including the incremental-version build fix and separate +characterization and port commits for `DefaultContent`. ## The one rule that matters @@ -67,7 +67,7 @@ awk -F'"' '/