Skip to content

Commit

Permalink
Clean up unused helper function (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored Dec 1, 2020
1 parent 00c6ad6 commit 4ad53df
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@
import com.google.api.generator.engine.ast.Expr;
import com.google.api.generator.engine.ast.ExprStatement;
import com.google.api.generator.engine.ast.MethodInvocationExpr;
import com.google.api.generator.engine.ast.Statement;
import com.google.api.generator.engine.ast.TypeNode;
import com.google.api.generator.engine.ast.VaporReference;
import com.google.api.generator.engine.ast.Variable;
import com.google.api.generator.engine.ast.VariableExpr;
import com.google.api.generator.engine.writer.JavaWriterVisitor;
import com.google.api.generator.gapic.composer.samplecode.SampleCodeJavaFormatter;
import com.google.api.generator.gapic.composer.samplecode.SampleCodeWriter;
import com.google.api.generator.gapic.utils.JavaStyle;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class ServiceClientSampleCodeComposer {
// TODO(summerji): Add unit tests for ServiceClientSampleCodeComposer.
Expand Down Expand Up @@ -162,16 +157,6 @@ public static String composeClassHeaderEndpointSampleCode(
}

// ======================================== Helpers ==========================================//
// TODO(summerji): Use writeSampleCode method in new class once PR#499 merged.
private static String writeSampleCode(List<Expr> exprs) {
List<Statement> statements =
exprs.stream().map(e -> ExprStatement.withExpr(e)).collect(Collectors.toList());
JavaWriterVisitor visitor = new JavaWriterVisitor();
for (Statement statement : statements) {
statement.accept(visitor);
}
return SampleCodeJavaFormatter.format(visitor.write());
}

private static VariableExpr createVariableExpr(String variableName, TypeNode type) {
return VariableExpr.withVariable(
Expand Down

0 comments on commit 4ad53df

Please sign in to comment.