Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 升级到 2.0.39 以及更新的版本 JSON.toJSON 报错 #2144

Closed
naivetoby opened this issue Dec 30, 2023 · 9 comments
Closed

[BUG] 升级到 2.0.39 以及更新的版本 JSON.toJSON 报错 #2144

naivetoby opened this issue Dec 30, 2023 · 9 comments
Labels
bug Something isn't working fixed
Milestone

Comments

@naivetoby
Copy link

问题描述

升级到 2.0.39 以及更新的版本 JSON.toJSON 报错

环境信息

请填写以下信息:

  • OS信息: macOS Sonoma 14.2.1
  • JDK信息: OpenJDK Runtime Environment Corretto-17.0.9.8.1
  • 版本信息:2.0.10 - 2.0.38 正常 / 2.0.39 - 2.0.44 报错

重现步骤

如何操作可以重现该问题:

@Data
public class A {

    public B buildB() {
        return buildB(new B());
    }

    public <T extends B> T buildB(T b) {
        return b;
    }

}

@Data
public class B {

    public B buildB() {
        return buildB(new B());
    }

    public <T extends B> T buildB(T b) {
        return b;
    }

}

public static void main(String[] args) {
    final A a = new A();
    log.info("b: {}", JSON.toJSON(a.buildB()));
}

版本 2.0.10 - 2.0.38 正常打印结果

-- b: {}

版本 2.0.39 - 2.0.44 控制台打印错误

com.alibaba.fastjson2.JSONException: level too large : 2048
	at com.alibaba.fastjson2.JSONWriterUTF16.startObject(JSONWriterUTF16.java:117)
	at com.alibaba.fastjson2.writer.OWG_1_1_B.write(Unknown Source)
	at com.alibaba.fastjson2.writer.OWG_1_1_B.write(Unknown Source)
	at com.alibaba.fastjson2.writer.OWG_1_1_B.write(Unknown Source)
@naivetoby naivetoby added the bug Something isn't working label Dec 30, 2023
@naivetoby
Copy link
Author

你好,是不是我反馈的问题描述不清晰?还是用法存在问题,辛苦给一个反馈,这个问题影响到公司底层框架的使用,非常紧急,万分感谢🙏!!!

@wenshao
Copy link
Member

wenshao commented Jan 4, 2024

问题已重现,我尽快处理,争取1月7日前修复发布新版本。

@naivetoby
Copy link
Author

问题已重现,我尽快处理,争取1月7日前修复发布新版本。

辛苦啦!!!

@wenshao
Copy link
Member

wenshao commented Jan 5, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.45-SNAPSHOT/
问题已修复,请帮2.0.45-SNAPSHOT验证问题是否已经修复,将会在1月7日前发布新版本

@naivetoby
Copy link
Author

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.45-SNAPSHOT/ 问题已修复,请帮2.0.45-SNAPSHOT验证问题是否已经修复,将会在1月7日前发布新版本

已修复

@wenshao wenshao added the fixed label Jan 6, 2024
@wenshao wenshao added this to the 2.0.45 milestone Jan 6, 2024
@wenshao
Copy link
Member

wenshao commented Jan 7, 2024

@wenshao wenshao closed this as completed Jan 7, 2024
@songhanlin
Copy link

2.0.47仍然存在

@sgalcheung
Copy link

Version 2.0.51 still has this problem.

@dlwss
Copy link

dlwss commented Sep 4, 2024

Version 2.0.52 still has this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

5 participants