且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

具有单参数的Jackson单参数构造函数因ParameterNameModule失败

更新时间:2023-11-13 13:44:28

您是否有机会使用-parameters选项编译JacksonTest?如果是这样,这是预期的行为. 过去,单参数构造函数曾被用作委托创建者. 即使在创建模块时,我也曾与@staxman讨论过此问题.各种用户多次弹出该问题,请参见此问题以获得详细信息. 展望未来,有望在3.0中进行更改,请参见本主题以获得详细信息.

Are you by any chance compiling JacksonTest with -parameters option? If so, this is expected behavior. Single argument constructors were historically used as delegating creators. I've had discussions about this matter with @staxman even when we created the module. The issue popped up a number of times by various users, see this issue for details. Looking to the future, this will hopefully be changed in 3.0, see this topic for details.

更新:关于3.0的更改,请参见此问题.如果您希望更改此行为,请添加+1或评论.目前尚不清楚哪种方法更好,因为有些用户需要旧的行为(有关更多详细信息,请参阅问题).

Update: regarding 3.0 change, see this issue. If you want this behavior to change please add +1 or comment. Right now it isn't clear if either approach is better as there are users that need the old behavior (see the issue for more details).