@@ -49,8 +49,7 @@ public class GaxProperties {
4949 private static final String DEFAULT_VERSION = "" ;
5050 private static final String GAX_VERSION = getLibraryVersion (GaxProperties .class , "version.gax" );
5151 private static final String JAVA_VERSION = getRuntimeVersion ();
52- private static final String PROTOBUF_VERSION =
53- getProtobufVersion (new ClassWrapper (), Any .class );
52+ private static final String PROTOBUF_VERSION = getProtobufVersion (new ClassWrapper (), Any .class );
5453
5554 private GaxProperties () {}
5655
@@ -151,9 +150,9 @@ static Optional<String> getBundleVersion(Class<?> clazz) {
151150 }
152151
153152 /**
154- * Returns the Protobuf runtime version as reported by com.google.protobuf.RuntimeVersion,
155- * if class is available, otherwise by reading from MANIFEST file. If niether option is available defaults to
156- * protobuf version 3 as RuntimeVersion class is available in protobuf version 4+
153+ * Returns the Protobuf runtime version as reported by com.google.protobuf.RuntimeVersion, if
154+ * class is available, otherwise by reading from MANIFEST file. If niether option is available
155+ * defaults to protobuf version 3 as RuntimeVersion class is available in protobuf version 4+
157156 */
158157 @ VisibleForTesting
159158 static String getProtobufVersion (ClassWrapper classWrapper , Class clazz ) {
@@ -165,8 +164,12 @@ static String getProtobufVersion(ClassWrapper classWrapper, Class clazz) {
165164 + classWrapper .getFieldValue (protobufRuntimeVersionClass , "MINOR" )
166165 + "."
167166 + classWrapper .getFieldValue (protobufRuntimeVersionClass , "PATCH" );
168- } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException | SecurityException e ) {
169- // If manifest file is not available default to protobuf generic version 3 as we know RuntimeVersion class is
167+ } catch (ClassNotFoundException
168+ | NoSuchFieldException
169+ | IllegalAccessException
170+ | SecurityException e ) {
171+ // If manifest file is not available default to protobuf generic version 3 as we know
172+ // RuntimeVersion class is
170173 // available in protobuf jar 4+.
171174 return getBundleVersion (clazz ).orElse ("3" );
172175 }
0 commit comments