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] fastjson 2.0.52 与@AllArgsConstructor注解冲突 #2901

Closed
gszs1013 opened this issue Aug 29, 2024 · 1 comment
Closed

[BUG] fastjson 2.0.52 与@AllArgsConstructor注解冲突 #2901

gszs1013 opened this issue Aug 29, 2024 · 1 comment
Labels
bug Something isn't working fixed
Milestone

Comments

@gszs1013
Copy link

问题描述

简要描述您碰到的问题。
你好 在使用fastjson 2.0.52 过程中发现一个与lombok的@AllArgsConstructor注解冲突的问题:带有@AllArgsConstructor注解会导致
@JSONField无效

    @Setter
    @Getter
    @AllArgsConstructor
    public class User  {
        @JSONField(name = "user_name")
        private String userName;

        @Override
        public String toString() {
            return "User{" +
                    "userName='" + userName + '\'' +
                    '}';
        }
    }

    public static void main(String[] args) {
        String str1 = "{\n" +
                "\"user_name\":\"zs\"\n" +
                "}";
        User user = JSONObject.parseObject(str1, User.class);
        System.out.println(user);
    }


  正常:   User{userName='zs'}
  异常:   User{userName='null'}

环境信息

请填写以下信息:

  • OS信息: []
  • JDK信息: [1.8]
  • 版本信息:[Fastjson2 2.0.52]
@gszs1013 gszs1013 added the bug Something isn't working label Aug 29, 2024
@wenshao wenshao added this to the 2.0.53 milestone Sep 2, 2024
@wenshao wenshao added the fixed label Sep 2, 2024
@wenshao
Copy link
Member

wenshao commented Sep 16, 2024

https://github.com/alibaba/fastjson2/releases/tag/2.0.53
问题已修复,请用新版本

@wenshao wenshao closed this as completed Sep 16, 2024
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

2 participants