refactor: port class symbol full names to Java

This commit is contained in:
Algent committed 2026-09-04 20:57:30 +02:00
1 parent 05c2792b87
commit 64f5abce6f
4 files changed
+37 -11

No files matched your search

+10 -10
View File
@@ -16,7 +16,7 @@ migration checkout; `codex/tile-compatibility-fixes` was deleted after its fixes
## Current state and next target
**484 plain-JVM tests and 237 Java 8 Forge tests pass, with zero failures/errors/skips.** Sources total **224 Java
**491 plain-JVM tests and 237 Java 8 Forge tests pass, with zero failures/errors/skips.** Sources total **224 Java
files and 9 Scala files / 744 nonblank Scala lines**. The packaged inventory has 443 classes.
Review follow-up: restored packet-scheduler callback mutation behavior with the original Scala hash-map traversal,
@@ -24,16 +24,16 @@ virtual tile accessor dispatch throughout `TMultiPart`, and null-safe equality f
Six JVM and two Forge regression cases cover the fixes. Callable signatures remain unchanged; the packet traversal
callback adds one anonymous class. See the latest history entries for the individual fixes and validation.
Latest bounded target: `ScalaSignature.TypeRefType.jDesc` delegates applied-type descriptor routing to
`ScalaSignatureParser.appliedTypeDescriptor`. Seven characterization tests were committed first as `5493086`. They
pin array argument and fallback routing, two/three virtual name reads, repeated uncached reads, malformed/null type
arguments, failure order and the retained method-type view. A frozen Scala 2.11.5 caller and subclass preserve the
old descriptor. All 484 frozen JVM consumers pass; checks preserve 442 retained class/member APIs, all 17
ScalaSignature payloads, 3,739 unrelated method bodies and all 116 generated dumps. No class is added or removed;
the total stays 443 classes. Evidence: `run/migration-applied-type-descriptor-reference/`.
Latest bounded target: `ScalaSignature.ClassSymbolRef.full` delegates owner/name concatenation to
`ScalaSignatureParser.classSymbolFull`. Seven characterization tests were committed first as `05c2792`. They pin
literal/null results, owner/full/name read order, repeated uncached reads, failure boundaries, unused member access
and the legacy static trait helper descriptor. A frozen Scala 2.11.5 caller and direct trait implementation preserve
the old `$class.full` bridge. All 491 frozen JVM consumers pass; checks preserve 442 retained class/member APIs, all
17 ScalaSignature payloads, 3,740 unrelated method bodies and all 116 generated dumps. No class is added or removed;
the total stays 443 classes. Evidence: `run/migration-class-symbol-full-reference/`.
**Next bounded candidate: `ScalaSignature.ClassSymbolRef.full`.** Characterize owner/name concatenation, virtual
read order, nulls and failures while retaining the trait, case-class and path-dependent declarations.
**Next bounded candidate: `ScalaSignature.MethodSymbol.full`.** Characterize owner/name concatenation, virtual read
order, nulls and failures while retaining the case-class and path-dependent declarations.
Keep case-class/product/serialization shapes and simple model accessors. Broader shell replacement and opcode
algorithm fixes remain separate work.
The external ProjectRed Scala-trait fixture and ScalaSignature model bridges remain required. Actual client
+21
View File
@@ -1580,3 +1580,24 @@ differences belong in the [divergence ledger](../../JAVA_MIGRATION_DIVERGENCES.m
frozen tests/resources, reports, logs and comparison tools. Frozen runs use its `version.txt`; final builds use the
committed version. Source totals are 224 Java files and nine Scala files / 744 nonblank lines. Next:
`ClassSymbolRef.full`, preserving owner/name concatenation, virtual reads and failure order.
### 2026-09-04 — ScalaSignature class-symbol full names
- Committed seven JVM characterization cases first as `05c2792` against the untouched `ClassSymbolRef.full`. They
pin concrete class/object names, punctuation, literal null full/name results, repeated owner/full/name read order,
null-owner and getter failure boundaries, unused symbol members and the exact static trait-helper descriptor.
- Added `ReferenceScalaClassSymbolFull`, compiled once with Scala 2.11.5 under Java 8 against the unchanged dev jar
at `24c7723`. Its frozen Scala caller and direct `ClassSymbolRef` implementation preserve the old `$class.full`
forwarder and virtual overrides. Source, encoded classes and SHA-256 provenance are committed under
`src/test/fixtures/` and `src/test/resources/compat/`; do not regenerate them against the port.
- Extracted concatenation into `ScalaSignatureParser.classSymbolFull(Object)`. Java retains owner getter, virtual
owner `full()` and name getter order plus Java/Scala null string conversion. Scala keeps the inferred return type,
trait helper, case-class forwarders, path-dependent declarations, products and serialization shapes.
- Normal and clean validation pass 491 JVM tests, all 491 frozen consumers and 237 Java 8 Forge tests with zero
failures/errors/skips. All 116 generated dumps match. Both jars contain 443 Java 8 classes and matching sources;
comparison preserves 442 retained class/member APIs, all 17 ScalaSignature payloads and 3,740 unrelated method
bodies. The helper adds one package-private method; no class inventory or effective divergence changes.
- Evidence is under ignored `run/migration-class-symbol-full-reference/`, including the reference/fixture jars,
frozen tests/resources, reports, logs and comparison tools. Frozen runs use its `version.txt`; final builds use the
committed version. Sources remain 224 Java files and nine Scala files / 744 nonblank lines. Next:
`MethodSymbol.full`, preserving owner/name concatenation, virtual reads and failure order.
@@ -49,7 +49,7 @@ class ScalaSignature(val bytes: Bytes) {
def flags: Int
def infoId: Int
def full = owner.full + "." + name
def full = ScalaSignatureParser.classSymbolFull(this)
override def toString = ScalaSignatureParser.classSymbolString(this)
def isObject = false
@@ -77,6 +77,11 @@ final class ScalaSignatureParser {
}, List$.MODULE$.canBuildFrom());
}
static String classSymbolFull(Object value) {
ScalaSignature.ClassSymbolRef symbol = (ScalaSignature.ClassSymbolRef) value;
return symbol.owner().full() + "." + symbol.name();
}
static String classSymbolString(Object value) {
ScalaSignature.ClassSymbolRef symbol = (ScalaSignature.ClassSymbolRef) value;
return symbol.getClass().getName().replaceAll(".+\\$", "") + "("