Tagged articles
2 articles
Page 1 of 1
Java Interview Crash Guide
Java Interview Crash Guide
May 9, 2024 · Backend Development

Why Does FastJSON Invoke isChinaName()? Uncovering Hidden Serialization Pitfalls

A seemingly harmless log addition triggered a cascade of FastJSON serialization calls, leading to a NullPointerException caused by the isChinaName() method, and the article walks through the debugging process, explains the underlying serialization mechanics, and proposes a clean solution using @JSONField(serialize=false).

JSONFieldJava serializationdebugging
0 likes · 8 min read
Why Does FastJSON Invoke isChinaName()? Uncovering Hidden Serialization Pitfalls
Selected Java Interview Questions
Selected Java Interview Questions
Nov 4, 2022 · Backend Development

FastJSON Serialization Mechanism: Why isChinaName() Is Invoked and How to Control Method Inclusion

This article analyzes a FastJSON serialization issue caused by an unexpected call to isChinaName(), explains the underlying JavaBeanSerializer workflow, demonstrates how ASM-generated serializers work, and proposes coding conventions using @JSONField to prevent unwanted method execution during JSON conversion.

JSONFieldJava serializationbackend-development
0 likes · 8 min read
FastJSON Serialization Mechanism: Why isChinaName() Is Invoked and How to Control Method Inclusion