simplify some java static initializers

Change-Id: Ic767b655297bfb5fcfb5cd7878d7131a9cb6b2f1