Skip to content

Commit a87d3b0

Browse files
committed
Fix linter.
1 parent 602b910 commit a87d3b0

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public class SettingsCommentComposer {
103103

104104
public SettingsCommentComposer(String transportPrefix) {
105105
this.newTransportBuilderMethodComment =
106-
toCommentStatement(String.format("Returns a new %s builder for this class.", transportPrefix));
106+
toCommentStatement(
107+
String.format("Returns a new %s builder for this class.", transportPrefix));
107108
this.transportProviderBuilderMethodComment =
108109
toCommentStatement(
109110
String.format(

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ protected TransportContext getTransportContext() {
130130
return transportContext;
131131
}
132132

133-
private static List<AnnotationNode> addMethodAnnotations(Method method, TypeStore typeStore)
134-
{
133+
private static List<AnnotationNode> addMethodAnnotations(Method method, TypeStore typeStore) {
135134
List<AnnotationNode> annotations = new ArrayList<>();
136135
if (method.isDeprecated()) {
137136
annotations.add(AnnotationNode.withType(TypeNode.DEPRECATED));
@@ -820,7 +819,8 @@ private static List<MethodDefinition> createMethodVariants(
820819
methodVariantBuilder.setReturnType(methodOutputType).setReturnExpr(rpcInvocationExpr);
821820
}
822821

823-
methodVariantBuilder = methodVariantBuilder.setAnnotations(addMethodAnnotations(method, typeStore));
822+
methodVariantBuilder =
823+
methodVariantBuilder.setAnnotations(addMethodAnnotations(method, typeStore));
824824
methodVariantBuilder = methodVariantBuilder.setBody(statements);
825825
javaMethods.add(methodVariantBuilder.build());
826826
}
@@ -898,7 +898,6 @@ private static MethodDefinition createMethodDefaultMethod(
898898
.setName(String.format(method.hasLro() ? "%sAsync" : "%s", methodName))
899899
.setArguments(Arrays.asList(requestArgVarExpr));
900900

901-
902901
if (isProtoEmptyType(methodOutputType)) {
903902
methodBuilder =
904903
methodBuilder

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ private static List<MethodDefinition> createSettingsGetterMethods(
283283
methodMakerFn.apply(getCallSettingsType(protoMethod, typeStore), javaMethodName);
284284
javaMethods.add(methodBuilderHelper(protoMethod, methodBuilder, javaMethodName));
285285
if (protoMethod.hasLro()) {
286-
String javaOperationSettingsMethodName = String.format("%sOperationSettings", javaStyleName);
286+
String javaOperationSettingsMethodName =
287+
String.format("%sOperationSettings", javaStyleName);
287288
methodBuilder =
288-
methodMakerFn.apply(getOperationCallSettingsType(protoMethod), javaOperationSettingsMethodName);
289-
javaMethods.add(methodBuilderHelper(protoMethod, methodBuilder, javaOperationSettingsMethodName));
289+
methodMakerFn.apply(
290+
getOperationCallSettingsType(protoMethod), javaOperationSettingsMethodName);
291+
javaMethods.add(
292+
methodBuilderHelper(protoMethod, methodBuilder, javaOperationSettingsMethodName));
290293
}
291294
}
292295
return javaMethods;

gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,8 @@ private List<MethodDefinition> createClassMethods(
10161016
return javaMethods;
10171017
}
10181018

1019-
private static List<AnnotationNode> createMethodAnnotation(boolean isDeprecated, boolean isInternal) {
1019+
private static List<AnnotationNode> createMethodAnnotation(
1020+
boolean isDeprecated, boolean isInternal) {
10201021
List<AnnotationNode> annotations = new ArrayList<>();
10211022
if (isDeprecated) {
10221023
annotations.add(AnnotationNode.withType(TypeNode.DEPRECATED));
@@ -1028,6 +1029,7 @@ private static List<AnnotationNode> createMethodAnnotation(boolean isDeprecated,
10281029
}
10291030
return annotations;
10301031
}
1032+
10311033
private static List<MethodDefinition> createMethodSettingsGetterMethods(
10321034
Map<String, VariableExpr> methodSettingsMemberVarExprs,
10331035
final Set<String> deprecatedSettingVarNames,

gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -477,14 +477,12 @@ static SelectiveGapicType getMethodSelectiveGapicType(
477477
// is in the allow list.
478478
// Otherwise, generate this method as INTERNAL or HIDDEN based on GenerateOmittedAsInternal
479479
// flag.
480-
if (includeMethodsList.isEmpty() && generateOmittedAsInternal == false || includeMethodsList.contains(method.getFullName())) {
480+
if (includeMethodsList.isEmpty() && generateOmittedAsInternal == false
481+
|| includeMethodsList.contains(method.getFullName())) {
481482
return SelectiveGapicType.PUBLIC;
482-
}
483-
else if (generateOmittedAsInternal)
484-
{
483+
} else if (generateOmittedAsInternal) {
485484
return SelectiveGapicType.INTERNAL;
486-
}
487-
else {
485+
} else {
488486
return SelectiveGapicType.HIDDEN;
489487
}
490488
}

0 commit comments

Comments
 (0)