Skip to content

Commit

Permalink
formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ldetmer committed Sep 18, 2024
1 parent 92e901b commit a202b8b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ static String getRuntimeVersion() {

/**
* Returns the current library version as reported by Bundle-Version attribute in library's
* META-INF/MANIFEST for libraries using OSGi bundle manifest https://www.ibm.com/docs/en/wasdtfe?topic=overview-osgi-bundles.
* This should only be used if MANIFEST file does not contain a widely recognized version declaration such as Specific-Version OR Implementation-Version declared in
* Manifest Specification
* META-INF/MANIFEST for libraries using OSGi bundle manifest
* https://www.ibm.com/docs/en/wasdtfe?topic=overview-osgi-bundles. This should only be used if
* MANIFEST file does not contain a widely recognized version declaration such as Specific-Version
* OR Implementation-Version declared in Manifest Specification
* https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Manifest_Specification,
* otherwise please use #getLibraryVersion
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ private static String checkAndAppendProtobufVersionIfNecessary(
Matcher matcher = pattern.matcher(apiClientHeaderValue);
if (matcher.find()) {
return apiClientHeaderValue.substring(0, matcher.end())
+ "--"
+ PROTOBUF_HEADER_VERSION_KEY
+ "-" + GaxProperties.getProtobufVersion()
+ "--"
+ PROTOBUF_HEADER_VERSION_KEY
+ "-"
+ GaxProperties.getProtobufVersion()
+ apiClientHeaderValue.substring(matcher.end());
}
return apiClientHeaderValue.toString();
Expand Down Expand Up @@ -132,7 +133,7 @@ public static class Builder {
private String generatedRuntimeToken;
private String transportToken;
private String quotaProjectIdToken;
final private String protobufRuntimeToken;
private final String protobufRuntimeToken;

private String resourceHeaderKey;
private String resourceToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.rpc;

import static com.google.api.gax.rpc.ApiClientHeaderProvider.PROTOBUF_HEADER_VERSION_KEY;
import static com.google.common.truth.Truth.assertThat;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -66,7 +65,8 @@ void testServiceHeaderManualGapic() {
.build();
assertThat(provider.getHeaders().size()).isEqualTo(1);
assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT))
.matches("^gl-java/.* gccl/4\\.5\\.6--protobuf-.* gapic/7\\.8\\.9 gax/.* grpc/1\\.2\\.3 protobuf/.*");
.matches(
"^gl-java/.* gccl/4\\.5\\.6--protobuf-.* gapic/7\\.8\\.9 gax/.* grpc/1\\.2\\.3 protobuf/.*");
}

@Test
Expand Down

0 comments on commit a202b8b

Please sign in to comment.