Understanding FastJson Serialization: Root Causes of NPE, Method Invocation Rules, and Best‑Practice Code Guidelines
This article reviews a production incident caused by a simple log statement, reconstructs the scenario with a CountryDTO example, analyzes FastJson's ASM‑based serializer internals, explains which getter/is methods are invoked during serialization, and proposes annotation‑driven coding standards to avoid similar bugs.
