Skip to content

Commit

Permalink
java format
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielGonzalezDiaz committed Aug 20, 2021
1 parent 67b42bd commit 703fc37
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ private static TypeStore createStaticTypes() {

@Override
protected Statement createMethodDescriptorVariableDecl(
Service service, Method protoMethod, VariableExpr methodDescriptorVarExpr, Map<String, Message> messageTypes) {
Service service,
Method protoMethod,
VariableExpr methodDescriptorVarExpr,
Map<String, Message> messageTypes) {
MethodInvocationExpr methodDescriptorMaker =
MethodInvocationExpr.builder()
.setMethodName("newBuilder")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected MethodDefinition createOperationCallableMethod(TypeStore typeStore) {
List<VariableExpr> arguments = method.arguments();
Variable httpJsonCallSettingsVar = arguments.get(0).variable();
Variable callSettingsVar = arguments.get(1).variable();
Variable clientContextVar = arguments.get(2).variable();
Variable clientContextVar = arguments.get(2).variable();
Variable operationsStub = arguments.get(3).variable();
// Generate innerCallable
VariableExpr innerCallableVarExpr =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import com.google.api.generator.gapic.model.Service;
import com.google.api.generator.gapic.utils.JavaStyle;
import com.google.common.collect.ImmutableList;
import com.google.longrunning.Operation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -97,7 +96,10 @@ private static TypeStore createStaticTypes() {

@Override
protected Statement createMethodDescriptorVariableDecl(
Service service, Method protoMethod, VariableExpr methodDescriptorVarExpr, Map<String, Message> messageTypes) {
Service service,
Method protoMethod,
VariableExpr methodDescriptorVarExpr,
Map<String, Message> messageTypes) {
MethodInvocationExpr expr =
MethodInvocationExpr.builder()
.setMethodName("newBuilder")
Expand All @@ -122,16 +124,18 @@ protected Statement createMethodDescriptorVariableDecl(
methodMaker.apply("setRequestFormatter", getRequestFormatterExpr(protoMethod)).apply(expr);
expr = methodMaker.apply("setResponseParser", setResponseParserExpr(protoMethod)).apply(expr);

//System.out.println(protoMethod.outputType().reference().simpleName());
if(protoMethod.outputType().reference().simpleName().equals("Operation")) {
// System.out.println(protoMethod.outputType().reference().simpleName());
if (protoMethod.outputType().reference().simpleName().equals("Operation")) {
expr =
methodMaker
.apply("setOperationSnapshotFactory",
.apply(
"setOperationSnapshotFactory",
setOperationSnapshotFactoryExpr(protoMethod, messageTypes))
.apply(expr);
expr =
methodMaker
.apply("setPollingRequestFactory",
.apply(
"setPollingRequestFactory",
setPollingRequestFactoryExpr(protoMethod, messageTypes))
.apply(expr);
}
Expand Down Expand Up @@ -376,7 +380,8 @@ private List<Expr> setResponseParserExpr(Method protoMethod) {
return Collections.singletonList(expr);
}

private List<Expr> setOperationSnapshotFactoryExpr(Method protoMethod, Map<String, Message> messageTypes) {
private List<Expr> setOperationSnapshotFactoryExpr(
Method protoMethod, Map<String, Message> messageTypes) {

BiFunction<String, List<Expr>, Function<MethodInvocationExpr, MethodInvocationExpr>>
methodMaker = getMethodMaker();
Expand Down Expand Up @@ -539,7 +544,8 @@ private List<Expr> setOperationSnapshotFactoryExpr(Method protoMethod, Map<Strin
.build());
}

private List<Expr> setPollingRequestFactoryExpr(Method protoMethod, Map<String, Message> messageTypes) {
private List<Expr> setPollingRequestFactoryExpr(
Method protoMethod, Map<String, Message> messageTypes) {

BiFunction<String, List<Expr>, Function<MethodInvocationExpr, MethodInvocationExpr>>
methodMaker = getMethodMaker();
Expand Down

0 comments on commit 703fc37

Please sign in to comment.