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-site.git
The following commit(s) were added to refs/heads/main by this push:
new d8ae3a962e 🔄 synced local 'docs/guide/' with remote 'docs/guide/'
d8ae3a962e is described below
commit d8ae3a962e93bad25a5d7d8a068982d434df0769
Author: chaokunyang <[email protected]>
AuthorDate: Sat Aug 1 13:39:37 2026 +0000
🔄 synced local 'docs/guide/' with remote 'docs/guide/'
---
docs/guide/java/json-support.md | 2 +-
docs/guide/java/troubleshooting.md | 40 +++++++++++++++++++++++++++++++++++++-
docs/guide/swift/index.md | 2 +-
3 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/docs/guide/java/json-support.md b/docs/guide/java/json-support.md
index a9bcdc3729..1dbeab5b94 100644
--- a/docs/guide/java/json-support.md
+++ b/docs/guide/java/json-support.md
@@ -1,6 +1,6 @@
---
title: JSON Support
-sidebar_position: 19
+sidebar_position: 18
id: json_support
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/guide/java/troubleshooting.md
b/docs/guide/java/troubleshooting.md
index 2795f83762..03bbb9afc1 100644
--- a/docs/guide/java/troubleshooting.md
+++ b/docs/guide/java/troubleshooting.md
@@ -1,6 +1,6 @@
---
title: Troubleshooting
-sidebar_position: 18
+sidebar_position: 19
id: troubleshooting
license: |
Licensed to the Apache Software Foundation (ASF) under one or more
@@ -98,6 +98,44 @@ public class DeserializeIntoType {
}
```
+## Cyclic References in Set Elements and Map Keys
+
+Fory supports cyclic references in object fields, arrays, lists, and map
values. However, an
+object that participates in a cycle must not be used as a `Set` element or a
`Map` key. This
+restriction applies to both hash-based and sorted containers, such as
`HashSet`, `TreeSet`,
+`HashMap`, and `TreeMap`.
+
+While resolving a cycle, Fory may expose an object's identity before all of
its fields have been
+deserialized. A container can therefore call `hashCode()`, `equals()`,
`compareTo()`, or a
+comparator while the object is only partially initialized. If later fields
affect those methods,
+the container's hash buckets or ordering become invalid. The object may still
appear during
+iteration even though `contains()` or `get()` cannot find it.
+
+When a set view is required, serialize the cyclic references as a list and
derive a transient set
+after deserialization:
+
+```java
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+public final class Node {
+ private final List<Node> parentList = new ArrayList<>();
+ private transient Set<Node> parents;
+
+ public Set<Node> getParents() {
+ if (parents == null) {
+ parents = new LinkedHashSet<>(parentList);
+ }
+ return parents;
+ }
+}
+```
+
+For a derived map, serialize an ordered list of key-value entries and build
the transient map after
+deserialization.
+
## Common Error Messages
### "Class not registered"
diff --git a/docs/guide/swift/index.md b/docs/guide/swift/index.md
index c2607e0bbf..6caa1a5798 100644
--- a/docs/guide/swift/index.md
+++ b/docs/guide/swift/index.md
@@ -37,7 +37,7 @@ Add Fory Swift from the Apache Fory GitHub repository:
```swift
dependencies: [
- .package(url: "https://github.com/apache/fory.git", exact: "1.5.0")
+ .package(url: "https://github.com/apache/fory.git", exact: "$version")
],
targets: [
.target(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]