Is it OK to use Gson instance as a static field in a model bean (reuse)?

It seems just fine to me. There is nothing in the GSON instance that makes it related to a specific instance of LoginSession, so it should be static.

GSON instances should be thread-safe, and there was a bug regarding that which was fixed.

Leave a Comment