Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

Commit eb26841

Browse files
authored
[ggj][engx][codegen] fix: use gapic-remapped names in package-info.java (#600)
* fix: fix dep ordering in Bazel dedupe rules * chore: centralize all Gapic class name getters * fix: use gapic-remapped names in package-info.java * fix: revert unrelated changes
1 parent 8355125 commit eb26841

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/main/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class ClientLibraryPackageInfoComposer {
3636
private static final String PACKAGE_INFO_DESCRIPTION =
3737
"The interfaces provided are listed below, along with usage samples.";
3838

39-
private static final String CLIENT_PATTERN = "%sClient";
4039
private static final String PACKAGE_INFO_TITLE_PATTERN = "A client to %s";
4140
private static final String SAMPLE_CODE_HEADER_PATTERN = "Sample for %s:";
4241
private static final String SERVICE_DESCRIPTION_HEADER_PATTERN = "Service Description: %s";
@@ -71,7 +70,7 @@ private static CommentStatement createPackageInfoJavadoc(GapicContext context) {
7170
javaDocCommentBuilder = javaDocCommentBuilder.addParagraph(PACKAGE_INFO_DESCRIPTION);
7271

7372
for (Service service : context.services()) {
74-
String javaClientName = String.format(CLIENT_PATTERN, service.name());
73+
String javaClientName = ClassNames.getServiceClientClassName(service);
7574
javaDocCommentBuilder =
7675
javaDocCommentBuilder.addParagraph(
7776
String.format("%s %s %s", DIVIDER, javaClientName, DIVIDER));
@@ -111,7 +110,6 @@ private static CommentStatement createPackageInfoJavadoc(GapicContext context) {
111110
javaDocCommentBuilder =
112111
javaDocCommentBuilder.addParagraph(
113112
String.format(SAMPLE_CODE_HEADER_PATTERN, javaClientName));
114-
115113
// TODO(summerji): Add package-info.java sample code here.
116114
}
117115

test/integration/goldens/logging/package-info.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717
/**
1818
* The interfaces provided are listed below, along with usage samples.
1919
*
20-
* <p>======================= LoggingServiceV2Client =======================
20+
* <p>======================= LoggingClient =======================
2121
*
2222
* <p>Service Description: Service for ingesting and querying logs.
2323
*
24-
* <p>Sample for LoggingServiceV2Client:
24+
* <p>Sample for LoggingClient:
2525
*
26-
* <p>======================= ConfigServiceV2Client =======================
26+
* <p>======================= ConfigClient =======================
2727
*
2828
* <p>Service Description: Service for configuring sinks used to route log entries.
2929
*
30-
* <p>Sample for ConfigServiceV2Client:
30+
* <p>Sample for ConfigClient:
3131
*
32-
* <p>======================= MetricsServiceV2Client =======================
32+
* <p>======================= MetricsClient =======================
3333
*
3434
* <p>Service Description: Service for configuring logs-based metrics.
3535
*
36-
* <p>Sample for MetricsServiceV2Client:
36+
* <p>Sample for MetricsClient:
3737
*/
3838
@Generated("by gapic-generator-java")
3939
package com.google.cloud.logging.v2;

0 commit comments

Comments
 (0)