Skip to content

Commit

Permalink
Unwrap a helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed Dec 8, 2020
1 parent 5907c4e commit 1fb3d51
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ private static List<MethodDefinition> createServiceMethods(
Map<String, TypeNode> types,
Map<String, ResourceName> resourceNames) {
List<MethodDefinition> javaMethods = new ArrayList<>();
String clientName = getClientClassName(service);
for (Method method : service.methods()) {
if (method.stream().equals(Stream.NONE)) {
javaMethods.addAll(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ static TryCatchStatement composeUnaryPagedRpcMethodSampleCode(
.setIsDecl(true)
.build())
.setCollectionExpr(clientMethodIteratorAllExpr)
.setBody(Arrays.asList(createLineCommentStatement("doThingsWith(element);")))
.setBody(
Arrays.asList(
CommentStatement.withComment(
LineComment.withComment("doThingsWith(element);"))))
.build();

List<Statement> bodyStatements =
Expand Down Expand Up @@ -412,8 +415,4 @@ private static boolean isProtoEmptyType(TypeNode type) {
return type.reference().pakkage().equals("com.google.protobuf")
&& type.reference().name().equals("Empty");
}

private static CommentStatement createLineCommentStatement(String content) {
return CommentStatement.withComment(LineComment.withComment(content));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void invalidComposeRpcMethodHeaderSampleCode_noRepeatedResponseTypeInPage
method, clientType, methodArguments, resourceNames, messageTypes));
}

// ==========================================Unary RPC Method Sample Code=======================//
// =======================================Unary RPC Method Sample Code=======================//
@Test
public void composeUnaryRpcMethodSampleCode_resourceNameMethodArgument() {
TypeNode clientType =
Expand Down

0 comments on commit 1fb3d51

Please sign in to comment.