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 2a63b9035 fix(java): fix classinfo npe on graalvm (#2572)
2a63b9035 is described below

commit 2a63b9035524a38f3cdb350df060df3627bb5241
Author: Shawn Yang <[email protected]>
AuthorDate: Wed Sep 3 16:32:40 2025 +0800

    fix(java): fix classinfo npe on graalvm (#2572)
    
    <!--
    **Thanks for contributing to Fory.**
    
    **If this is your first time opening a PR on fory, you can refer to
    
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).**
    
    Contribution Checklist
    
    - The **Apache Fory** community has requirements on the naming of pr
    titles. You can also find instructions in
    [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).
    
    - Fory has a strong focus on performance. If the PR you submit will have
    an impact on performance, please benchmark it first and provide the
    benchmark result here.
    -->
    
    ## Why?
    
    <!-- Describe the purpose of this PR. -->
    
    ## What does this PR do?
    
    <!-- Describe the details of this PR. -->
    
    ## Related issues
    
    <!--
    Is there any related issue? If this PR closes them you say say
    fix/closes:
    
    - #xxxx0
    - #xxxx1
    - Fixes #xxxx2
    -->
    
    ## Does this PR introduce any user-facing change?
    
    <!--
    If any user-facing interface changes, please [open an
    issue](https://github.com/apache/fory/issues/new/choose) describing the
    need to do so and update the document if necessary.
    
    Delete section if not applicable.
    -->
    
    - [ ] Does this PR introduce any public API change?
    - [ ] Does this PR introduce any binary protocol compatibility change?
    
    ## Benchmark
    
    <!--
    When the PR has an impact on performance (if you don't know whether the
    PR will have an impact on performance, you can submit the PR first, and
    if it will have impact on performance, the code reviewer will explain
    it), be sure to attach a benchmark data here.
    
    Delete section if not applicable.
    -->
---
 .../src/main/java/org/apache/fory/resolver/ClassResolver.java          | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/java/fory-core/src/main/java/org/apache/fory/resolver/ClassResolver.java 
b/java/fory-core/src/main/java/org/apache/fory/resolver/ClassResolver.java
index 3f2f339cd..471a6069e 100644
--- a/java/fory-core/src/main/java/org/apache/fory/resolver/ClassResolver.java
+++ b/java/fory-core/src/main/java/org/apache/fory/resolver/ClassResolver.java
@@ -1431,6 +1431,7 @@ public class ClassResolver implements TypeResolver {
         Tuple2<ClassDef, ClassInfo> classDefTuple = 
extRegistry.classIdToDef.get(classDef.getId());
         // empty serializer for graalvm build time
         classDefTuple.f1.serializer = null;
+        classInfoCache = NIL_CLASS_INFO;
         extRegistry.classIdToDef.put(classDef.getId(), 
Tuple2.of(classDefTuple.f0, null));
       }
     }
@@ -1440,6 +1441,7 @@ public class ClassResolver implements TypeResolver {
           .serializerClassMap
           .put(cls, getGraalvmSerializerClass(classInfo.serializer));
       classInfo.serializer = null;
+      classInfoCache = NIL_CLASS_INFO;
     }
   }
 
@@ -2245,6 +2247,7 @@ public class ClassResolver implements TypeResolver {
               }
             });
       }
+      classInfoCache = NIL_CLASS_INFO;
     } finally {
       fory.getJITContext().unlock();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to