Question 1
Look at springmvc source Profiling (v)-Message converter Httpmessageconverter , in the See the following code in Org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor:
protected Abstractmessageconvertermethodprocessor (list converters) { This (Converters, (Contentnegotiationmanager)null);}
The time did not react to why the strong turn null.
The static method of the corresponding class can be called after the null has been strongly transferred since it was previously tested. A moment to think of a fork---especially no longer notice here is the construction method.
Internet help, someone reply sharply, this is to distinguish different construction methods.
Because, if there is a construction method as follows:
Public class x { x (a A, b b) {...}; X (A A, C c) {...}; }
Then, when you call X (A, null ), you don't know which method to construct!
Therefore, it is necessary to turn a strong, so as to distinguish.
Question 2
Talk to coworkers. iOS parsing JSON crashes when it encounters null.
Although I firmly believe that this is the iOS parsing tool is too weak-after all, JSON is a common format, but the problem still needs to be solved.
The easy way is to use Jackson to label the entity class, ignoring the null-valued attribute.
Reference
Jackson entity to JSON null or NULL to not participate in serialization
SPRINGMVC Source Analysis (v)-Message converter Httpmessageconverter
Null issues with JSON parsing in iOS
Bulk: null strong turn and IOS null crash