Files
gerrit/java/com
Dave Borowitz 52e5bbbbc1 Simplify and clarify exception throwing of CacheSerializer
Previously, CacheSerializer threw IOException for the convenience of
implementors, since some implementations were based on APIs like
InputStream/OutputStream that threw IOException. However, this didn't
cover all the possible exceptions that could be thrown; callers also
neded to be prepared to catch RuntimeException. Throwing checked
exceptions in some case and unchecked exceptions in others might have
given the impression that these cases were fundamentally different and
required different handling, which is not the case.

In addition, generally speaking, these classes are null-hostile. Use
checkNotNull in EnumCacheSerializer so the intent is clear.

Also in EnumCacheSerializer, delegate to Enums#stringConverter rather
than rolling our own.

Change-Id: I37f1cf73d961be477af389c4043bb1c10c45972c
2018-05-14 14:26:50 -07:00
..