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/incubator-fury-site.git
The following commit(s) were added to refs/heads/main by this push: new 3bfd223 🔄 synced local 'docs/guide/' with remote 'docs/guide/' 3bfd223 is described below commit 3bfd2238fb5d65577889cd6ecdef538f8246e4b3 Author: chaokunyang <shawn.ck.y...@gmail.com> AuthorDate: Fri May 31 10:12:26 2024 +0000 🔄 synced local 'docs/guide/' with remote 'docs/guide/' --- docs/guide/java_serialization_guide.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/guide/java_serialization_guide.md b/docs/guide/java_serialization_guide.md index ec9fdf3..4869d83 100644 --- a/docs/guide/java_serialization_guide.md +++ b/docs/guide/java_serialization_guide.md @@ -30,8 +30,6 @@ public class Example { // Note that Fury instances should be reused between // multiple serializations of different objects. Fury fury = Fury.builder().withLanguage(Language.JAVA) - // Allow to deserialize objects unknown types, more flexible - // but may be insecure if the classes contains malicious code. .requireClassRegistration(true) .build(); // Registering types can reduce class name serialization overhead, but not mandatory. @@ -80,11 +78,12 @@ import org.apache.fury.config.*; public class Example { // reuse fury. - private static final ThreadSafeFury fury = Fury.builder() - // Allow to deserialize objects unknown types, more flexible - // but may be insecure if the classes contains malicious code. - .requireClassRegistration(true) - .buildThreadSafeFury(); + private static final ThreadSafeFury fury = new ThreadLocalFury(classLoader -> { + Fury f = Fury.builder().withLanguage(Language.JAVA) + .withClassLoader(classLoader).build(); + f.register(SomeClass.class); + return f; + }); public static void main(String[] args) { SomeClass object = new SomeClass(); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org For additional commands, e-mail: commits-h...@fury.apache.org