Skip to content

Commit b481cc7

Browse files
committed
Change block tag to start with lowercase to resolve formatter issue.
1 parent 6c30173 commit b481cc7

File tree

6 files changed

+37
-46
lines changed

6 files changed

+37
-46
lines changed

gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/JavaDocComment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public JavaDocComment build() {
160160
componentsList.add(String.format("@deprecated %s", deprecated));
161161
}
162162
if (!Strings.isNullOrEmpty(internalOnly)) {
163-
componentsList.add(String.format("@InternalApi %s", internalOnly));
163+
componentsList.add(String.format("@internalApi %s", internalOnly));
164164
}
165165
if (!Strings.isNullOrEmpty(returnDescription)) {
166166
componentsList.add(String.format("@return %s", returnDescription));

gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,15 +1020,6 @@ public void visit(ClassDefinition classDefinition) {
10201020
if (!classDefinition.isNested()) {
10211021
String formattedClazz = JavaFormatter.format(buffer.toString());
10221022

1023-
// fixing @InternalApi comment after formatting
1024-
// formatter removes the line break before @InternalApi comment.
1025-
// See https://github.com/google/google-java-format/issues/1249
1026-
// Ensures '@InternalApi' Javadoc comment has a line break and a standard '* ' prefix.
1027-
formattedClazz =
1028-
formattedClazz.replaceAll(
1029-
"(?s)(/\\*\\*.*?)(@InternalApi[^\r\n]*)(?:\\r?\\n\\h*\\*\\h+)((?!@|\\*/)[^\r\n]*)(.*?\\*/)",
1030-
"$1 \n * $2 $3$4");
1031-
10321023
// fixing region tag after formatting
10331024
// formatter splits long region tags on multiple lines and moves the end tag up - doesn't meet
10341025
// tag requirements. See https://github.com/google/google-java-format/issues/137

gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void createJavaDocComment_throwsAndDeprecatedAndInternalAndReturn() {
219219
LineFormatter.lines(
220220
"@throws java.lang.RuntimeException if the remote call fails.\n",
221221
"@deprecated Use the {@link ShelfBookName} class instead.\n",
222-
"@InternalApi This method is internal used only. Please do not use directly.\n",
222+
"@internalApi This method is internal used only. Please do not use directly.\n",
223223
"@return This is the correct method return text.");
224224
assertEquals(expected, javaDocComment.comment());
225225
}
@@ -278,7 +278,7 @@ void createJavaDocComment_allComponents() {
278278
"@param shelf The shelf to create.\n",
279279
"@throws com.google.api.gax.rpc.ApiException if the remote call fails.\n",
280280
"@deprecated Use the {@link ArchivedBookName} class instead.\n",
281-
"@InternalApi This method is internal used only. Please do not use directly.\n",
281+
"@internalApi This method is internal used only. Please do not use directly.\n",
282282
"@return This is the method return text.");
283283
assertEquals(expected, javaDocComment.comment());
284284
}

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe
438438
* }</pre>
439439
*
440440
* @param request The request object containing all of the parameters for the API call.
441-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
442-
* @InternalApi This method is internal used only. Please do not use directly.
441+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
442+
* @internalApi This method is internal used only. Please do not use directly.
443443
*/
444444
@InternalApi("Internal API. This API is not intended for public consumption.")
445445
public final EchoResponse chatShouldGenerateAsInternal() {
@@ -466,8 +466,8 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe
466466
* }</pre>
467467
*
468468
* @param name
469-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
470-
* @InternalApi This method is internal used only. Please do not use directly.
469+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
470+
* @internalApi This method is internal used only. Please do not use directly.
471471
*/
472472
@InternalApi("Internal API. This API is not intended for public consumption.")
473473
public final EchoResponse chatShouldGenerateAsInternal(FoobarName name) {
@@ -495,8 +495,8 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe
495495
* }</pre>
496496
*
497497
* @param name
498-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
499-
* @InternalApi This method is internal used only. Please do not use directly.
498+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
499+
* @internalApi This method is internal used only. Please do not use directly.
500500
*/
501501
@InternalApi("Internal API. This API is not intended for public consumption.")
502502
public final EchoResponse chatShouldGenerateAsInternal(String name) {
@@ -528,8 +528,8 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe
528528
* }</pre>
529529
*
530530
* @param request The request object containing all of the parameters for the API call.
531-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
532-
* @InternalApi This method is internal used only. Please do not use directly.
531+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
532+
* @internalApi This method is internal used only. Please do not use directly.
533533
*/
534534
@InternalApi("Internal API. This API is not intended for public consumption.")
535535
public final EchoResponse chatShouldGenerateAsInternal(EchoRequest request) {
@@ -563,7 +563,7 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe
563563
* }
564564
* }</pre>
565565
*
566-
* @InternalApi This method is internal used only. Please do not use directly.
566+
* @internalApi This method is internal used only. Please do not use directly.
567567
*/
568568
@InternalApi("Internal API. This API is not intended for public consumption.")
569569
public final UnaryCallable<EchoRequest, EchoResponse> chatShouldGenerateAsInternalCallable() {
@@ -597,7 +597,7 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe
597597
* }
598598
* }</pre>
599599
*
600-
* @InternalApi This method is internal used only. Please do not use directly.
600+
* @internalApi This method is internal used only. Please do not use directly.
601601
*/
602602
@InternalApi("Internal API. This API is not intended for public consumption.")
603603
public final BidiStreamingCallable<EchoRequest, EchoResponse>

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ public class EchoServiceShouldGeneratePartialUsualSettings
9494
}
9595

9696
/**
97-
* Returns the object with the settings used for calls to
98-
* chatShouldGenerateAsInternal.
99-
* @InternalApi This method is internal used only. Please do not use directly.
97+
* Returns the object with the settings used for calls to chatShouldGenerateAsInternal.
98+
*
99+
* @internalApi This method is internal used only. Please do not use directly.
100100
*/
101101
@InternalApi("Internal API. This API is not intended for public consumption.")
102102
public UnaryCallSettings<EchoRequest, EchoResponse> chatShouldGenerateAsInternalSettings() {
@@ -105,9 +105,9 @@ public class EchoServiceShouldGeneratePartialUsualSettings
105105
}
106106

107107
/**
108-
* Returns the object with the settings used for calls to
109-
* echoShouldGenerateAsInternal.
110-
* @InternalApi This method is internal used only. Please do not use directly.
108+
* Returns the object with the settings used for calls to echoShouldGenerateAsInternal.
109+
*
110+
* @internalApi This method is internal used only. Please do not use directly.
111111
*/
112112
@InternalApi("Internal API. This API is not intended for public consumption.")
113113
public StreamingCallSettings<EchoRequest, EchoResponse> echoShouldGenerateAsInternalSettings() {
@@ -233,9 +233,9 @@ public class EchoServiceShouldGeneratePartialUsualSettings
233233
}
234234

235235
/**
236-
* Returns the builder for the settings used for calls to
237-
* chatShouldGenerateAsInternal.
238-
* @InternalApi This method is internal used only. Please do not use directly.
236+
* Returns the builder for the settings used for calls to chatShouldGenerateAsInternal.
237+
*
238+
* @internalApi This method is internal used only. Please do not use directly.
239239
*/
240240
@InternalApi("Internal API. This API is not intended for public consumption.")
241241
public UnaryCallSettings.Builder<EchoRequest, EchoResponse>
@@ -244,9 +244,9 @@ public class EchoServiceShouldGeneratePartialUsualSettings
244244
}
245245

246246
/**
247-
* Returns the builder for the settings used for calls to
248-
* echoShouldGenerateAsInternal.
249-
* @InternalApi This method is internal used only. Please do not use directly.
247+
* Returns the builder for the settings used for calls to echoShouldGenerateAsInternal.
248+
*
249+
* @internalApi This method is internal used only. Please do not use directly.
250250
*/
251251
@InternalApi("Internal API. This API is not intended for public consumption.")
252252
public StreamingCallSettings.Builder<EchoRequest, EchoResponse>

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ public class EchoServiceShouldGeneratePartialUsualStubSettings
113113
}
114114

115115
/**
116-
* Returns the object with the settings used for calls to
117-
* chatShouldGenerateAsInternal.
118-
* @InternalApi This method is internal used only. Please do not use directly.
116+
* Returns the object with the settings used for calls to chatShouldGenerateAsInternal.
117+
*
118+
* @internalApi This method is internal used only. Please do not use directly.
119119
*/
120120
@InternalApi("Internal API. This API is not intended for public consumption.")
121121
public UnaryCallSettings<EchoRequest, EchoResponse> chatShouldGenerateAsInternalSettings() {
122122
return chatShouldGenerateAsInternalSettings;
123123
}
124124

125125
/**
126-
* Returns the object with the settings used for calls to
127-
* echoShouldGenerateAsInternal.
128-
* @InternalApi This method is internal used only. Please do not use directly.
126+
* Returns the object with the settings used for calls to echoShouldGenerateAsInternal.
127+
*
128+
* @internalApi This method is internal used only. Please do not use directly.
129129
*/
130130
@InternalApi("Internal API. This API is not intended for public consumption.")
131131
public StreamingCallSettings<EchoRequest, EchoResponse> echoShouldGenerateAsInternalSettings() {
@@ -350,9 +350,9 @@ public class EchoServiceShouldGeneratePartialUsualStubSettings
350350
}
351351

352352
/**
353-
* Returns the builder for the settings used for calls to
354-
* chatShouldGenerateAsInternal.
355-
* @InternalApi This method is internal used only. Please do not use directly.
353+
* Returns the builder for the settings used for calls to chatShouldGenerateAsInternal.
354+
*
355+
* @internalApi This method is internal used only. Please do not use directly.
356356
*/
357357
@InternalApi("Internal API. This API is not intended for public consumption.")
358358
public UnaryCallSettings.Builder<EchoRequest, EchoResponse>
@@ -361,9 +361,9 @@ public class EchoServiceShouldGeneratePartialUsualStubSettings
361361
}
362362

363363
/**
364-
* Returns the builder for the settings used for calls to
365-
* echoShouldGenerateAsInternal.
366-
* @InternalApi This method is internal used only. Please do not use directly.
364+
* Returns the builder for the settings used for calls to echoShouldGenerateAsInternal.
365+
*
366+
* @internalApi This method is internal used only. Please do not use directly.
367367
*/
368368
@InternalApi("Internal API. This API is not intended for public consumption.")
369369
public StreamingCallSettings.Builder<EchoRequest, EchoResponse>

0 commit comments

Comments
 (0)