drse opened a new issue, #3621: URL: https://github.com/apache/fory/issues/3621
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/fory/issues) and found no similar issues. ### Version 0.17.0 ### Component(s) Java ### Minimal reproduce step Tested with Eclipse Collections' `UnifiedMap` (any non-`java.util` `Map` impl should reproduce): ```java import org.apache.fory.Fory; import org.apache.fory.config.CompatibleMode; import org.apache.fory.config.Language; import org.eclipse.collections.api.map.MutableMap; import org.eclipse.collections.impl.map.mutable.UnifiedMap; public class Holder { public MutableMap<String, String> data = new UnifiedMap<>(); } Fory fory = Fory.builder() .withLanguage(Language.JAVA) .withCompatibleMode(CompatibleMode.COMPATIBLE) .requireClassRegistration(false) .build(); Holder h = new Holder(); h.data.put("k", "v"); byte[] bytes = fory.serialize(h); // entry is written to the buffer Holder out = (Holder) fory.deserialize(bytes); System.out.println(out.data.getClass()); // class ...UnifiedMap System.out.println(out.data.size()); // 0 ← silent loss ``` - `CompatibleMode.SCHEMA_CONSISTENT` (with the class registered) → entry survives. - Field typed as `java.util.LinkedHashMap` (still COMPATIBLE) → entry survives. - Registering a `CustomMapSerializer<UnifiedMap>` per the [custom-serializers guide](https://github.com/apache/fory/blob/main/docs/guide/java/custom-serializers.md) → entry survives. ### What did you expect to see? One of: 1. COMPATIBLE-mode generic dispatch routes unknown `Map` / `Collection` implementations through `MapSerializer` / `CollectionSerializer` so entries survive without explicit registration. 2. COMPATIBLE-mode throws on encountering a `Map` / `Collection` impl it cannot fully round-trip, so the failure is loud at the boundary. ### What did you see instead? Silent partial deserialization. Empty collection created, no exceptions thrown. ### Anything Else? I think the default silent behavior is probably correct for most types, but for known collection types, the default behavior should probably be to throw. At least that's my default expectation. ### Are you willing to submit a PR? - [ ] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
