This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git
The following commit(s) were added to refs/heads/main by this push:
new ac057a07 feat(java): Adding explanatory message to
`deserializeNonexistentClass` misconfiguration in `Config` (#2300)
ac057a07 is described below
commit ac057a07a8da45ad0dab286e751a1812fd4a9692
Author: David Rose <[email protected]>
AuthorDate: Thu Jun 5 19:44:45 2025 -0700
feat(java): Adding explanatory message to `deserializeNonexistentClass`
misconfiguration in `Config` (#2300)
## What does this PR do?
#2272: adding a clear message when failing `deserializeNonexistentClass`
precondition check in `Config`.
---
java/fory-core/src/main/java/org/apache/fory/config/Config.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/java/fory-core/src/main/java/org/apache/fory/config/Config.java
b/java/fory-core/src/main/java/org/apache/fory/config/Config.java
index be1eec21..251f0223 100644
--- a/java/fory-core/src/main/java/org/apache/fory/config/Config.java
+++ b/java/fory-core/src/main/java/org/apache/fory/config/Config.java
@@ -90,9 +90,11 @@ public class Config implements Serializable {
metaCompressor = builder.metaCompressor;
deserializeNonexistentClass = builder.deserializeNonexistentClass;
if (deserializeNonexistentClass) {
- // Only in meta share mode or compatibleMode, fory knows how to
deserialize
- // unexisted class by type info in data.
- Preconditions.checkArgument(metaShareEnabled || compatibleMode ==
CompatibleMode.COMPATIBLE);
+ Preconditions.checkArgument(
+ metaShareEnabled || compatibleMode == CompatibleMode.COMPATIBLE,
+ "Configuration error: deserializeNonexistentClass=true requires
either "
+ + "metaShareEnabled=true to access type information OR
compatibleMode=COMPATIBLE "
+ + "to automatically resolve class schemas.");
}
asyncCompilationEnabled = builder.asyncCompilationEnabled;
scalaOptimizationEnabled = builder.scalaOptimizationEnabled;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]