alibaba / alibaba/fastjson2

[FEATURE]支持指定类加载器反序列化类

Open
#2,826 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

### 请描述您的需求或者改进建议
当我使用json.toJavaObject(A.class)时,本身A.class是已经完成类加载的(被自定义类加载器加载),但是还是报A.class ClassNotFoundException。我本想看是否能使用指定类加载器加载,但是没找到对应接口方法

###希望提供的实现
是否不重复进行类加载或者支持指定类加载器

Contributor guide

Open the contributing guide

Research direction

Start at the json.toJavaObject(A.class) entry point and trace how fastjson2 resolves classes during deserialization, especially when A.class came from a custom class loader. Define whether the change should reuse the supplied class or accept an explicit loader, then add coverage showing the custom-loader case succeeds without ClassNotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.