You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In OsonFactory, OracleJsonFactory is constructed as a static member. While there is no correctness issue here, it may sometimes be beneficial to not have a single global instance with pooled memory. Also it seems incongruous for OsonFactory to not be a singleton when it wraps a singleton. Suggest making OsonFactory non-static, adding a constructor that allows OracleJsonFactory to optionally be passed from the outside, and adding a getter to access the factory.
In JacksonOsonConverter, there is a single static instance of OracleJsonFactory and ObjectMapper. ObjectMapper is mutable so handing out a single instance from getObjectMapper() isn't appropriate. One consumer could mutate the instance and the effects would be observed by all of the consumers. Suggest making both OracleJsonFactory and ObjectMapper non-static. Add a non-static method to create an objectMapper rather than get one. Although, I'm not clear on what the public usage patterns are for JacksonOsonConverter so some other solution may be more appropriate than the one I'm suggestion.
The text was updated successfully, but these errors were encountered:
In OsonFactory, OracleJsonFactory is constructed as a static member. While there is no correctness issue here, it may sometimes be beneficial to not have a single global instance with pooled memory. Also it seems incongruous for OsonFactory to not be a singleton when it wraps a singleton. Suggest making OsonFactory non-static, adding a constructor that allows OracleJsonFactory to optionally be passed from the outside, and adding a getter to access the factory.
In JacksonOsonConverter, there is a single static instance of OracleJsonFactory and ObjectMapper. ObjectMapper is mutable so handing out a single instance from getObjectMapper() isn't appropriate. One consumer could mutate the instance and the effects would be observed by all of the consumers. Suggest making both OracleJsonFactory and ObjectMapper non-static. Add a non-static method to create an objectMapper rather than get one. Although, I'm not clear on what the public usage patterns are for JacksonOsonConverter so some other solution may be more appropriate than the one I'm suggestion.
The text was updated successfully, but these errors were encountered: