Repository navigation
Conversation
…roperty streams Use an empty serializable superclass to distinguish the historical class-data ordering before DynaProperty reads any input. Keep UID 1L and the existing primitive-class codec; always emit the new default-fields-first ordering. Exercise the actual JBoss ObjectCloner, legacy read/rewrite/clone transitions, and subclass state while preserving all 22 historical serialization fixtures. Document the permanent marker and the new-reader compatibility boundary. Generated-by: OpenAI ChatGPT (GPT-6 Astra Pro)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
BEANUTILS-417:
DynaProperty.writeObjectwrites custom class metadata before default fields. The actual JBoss Marshalling serializingObjectClonerrejects this ordering withIllegalStateException: defaultWriteObject may not be called in this context.This targets the maintained
1.Xbranch and follows the earlier maintainer requirement: a new writer format is permitted if the new reader accepts both old and new data. Callers continue to use their ordinaryObjectInputStream.Change
readObjectNoData()marks the legacy ordering beforeDynaPropertyreads its data. New streams include the marker and use the new ordering.DynaProperty's UID1L, public/protected members, transient class fields and primitive-class codec..serfixtures and their existing reader test unchanged; update the three assertions that deliberately checked the old writer order.Compatibility qualification
Japicmp reports
DynaPropertyas binary- and source-compatible, with UID1Lretained, and explicitly flagsSERIALIZABLE_INCOMPATIBLE_SUPERCLASS_MODIFIED. This finding has not been suppressed. The added superclass, including its name, UID, empty persistent form and position, becomes part of the serialized protocol; reflection observes the hierarchy change.The intended guarantee is new readers accept historical and new data. Earlier library releases reading newly written data are not supported by this change. The legacy fixtures, new round trips and an unchanged baseline-compiled subclass exercise the intended direction.
Executed proof
Source:
1d95c95c3045da8939db4c93ba2d13cf27ae241f, based on22354f22fb150f82ae8cb7d4e444d2bf0d2bb1ff.Immutable proof packet — full sanitized logs, exact commands/timestamps, source and fixture hashes, failed/skipped cases, gate reports, a tests-only baseline patch, and the precompiled-client evidence. The proof lives on a separate fork branch; this PR changes five source/test/changelog/build files.
The baseline has three writer-order assertion failures and nine strict-cloner errors. Primitive-int cloning already passes on the baseline; all twelve former failure/error cases pass with the fix. One active compatibility test reads the 22 unchanged fixtures; these are not counted as 22 separate JUnit cases.
The supplemental client/subclass was compiled once against baseline classes, then its unchanged bytecode passed write and read/rewrite modes against the fixed classes. It checks constructor/protected-field linkage, UID, historical subclass input and subclass-specific final state.
Focused command:
mvn -Dtest=DynaProperty* clean test. Full validation used Maven without an explicit goal or test selector, executing the unchanged defaultclean apache-rat:check verify japicmp:cmp javadoc:javadoc checkstyle:check. RAT: 292 approved, zero unknown/unapproved; Checkstyle: zero violations; Japicmp completed with the qualification above; Javadoc generated. Full logs retain the nonfatal dependency-metadata/SPDX and schema warnings, including a minimal SPDX package for the existing test-framework dependency.Environment: Maven 3.9.11, OpenJDK 17.0.20, Linux amd64, compiler release 8. Environment-only JDK-module launchers replace missing native launchers. The full run reports eight skips in unchanged tests; the existing memory-test exclusions remain unchanged. No Java 8 runtime, other platform, full application-server, coverage-percentage or hosted-CI result is claimed. Tests ran before commit creation; all captured fixed-run source bytes were subsequently verified against the linked commit and complete tree.
Contribution checklist and AI disclosure
Generated-bytrailer.