You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aef30c5
Browse filesBrowse the repository at this point in the historyBrowse files
feat(java,kotlin,python,csharp): port cross-package reference resolution contract (ADR-0041)
Fan-out of the TS reference (60bd97d). All 5 ports now pass the shared
cross-package conformance matrix byte-identically.
- Java (the confirmed bug): SymbolTable.nameMatches / ValidationPhase.nameMatches
matched the ref's bare TAIL before the exact-FQN check, so an explicit FQN
`xpkg::vendor::Customer` silently bound `xpkg::crm::Customer` (wrong package /
wrong FK table). Now: an FQN ref (`ref.contains("::")`) resolves EXACTLY
(`ref.equals(child.getName())`), never a bare-tail fallback; bare refs match the
short name. Fixes xpkg-collision-extends-fqn (effective serialization now
inherits from the correct package).
- All ports: ERR_AMBIGUOUS_REF registered + a validateCrossPackageRefs pass
emitting it for a bare object-ref that names an object in >1 package with none
in the referrer's own package (mirrors the TS validateCrossPackageRefs). Python
and C# already resolved FQNs exactly (no matcher bug), so they only added the
ambiguity pass + resolver helper.
- Codegen touched where it shared the bare-match bug (codegen-spring
SpringM2mSupport, codegen-kotlin render helper); codegen same-package
target-selection remains a follow-up (matching the TS residual note).
Verified: Java ConformanceTest 420/0 + Kotlin conformance green; Python 323/0;
C# 710/0. All emit ERR_AMBIGUOUS_REF on the ambiguity fixture and resolve the
FQN-collision fixture to the correct package.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ew1XfYSbEAezxjs9opynAe
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinRenderHelperGenerator.kt
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -260,10 +260,15 @@ open class KotlinRenderHelperGenerator : MultiFileDirectGeneratorBase<MetaObject
260
260
if (!field.hasMetaAttr(MetaObject.ATTR_OBJECT_REF, true)) returnnull
261
261
val ref = field.getMetaAttr(MetaObject.ATTR_OBJECT_REF, true).valueAsString
262
262
if (ref.isNullOrEmpty()) returnnull
263
-
val refShort = ref.substringAfterLast("::")
263
+
// ADR-0041: a FULLY-QUALIFIED @objectRef (contains "::") resolves EXACTLY on the
264
+
// value-object's package-qualified name — never a bare-tail fallback (the closed
265
+
// bug: an FQN ref binding a same-named object.value in the WRONG package). A bare
266
+
// ref matches the object.value's short name (the cross-port render-helper consensus).
267
+
val fqn = ref.contains("::")
264
268
for (obj in loader.metaObjects) {
265
269
if (MetaObject.SUBTYPE_VALUE!= obj.subType) continue
266
-
if (obj.name.substringAfterLast("::") == refShort) return obj
0 commit comments