Skip to content

Commit

Permalink
Revert "fix(ast): add import generation for annotations on VariableEx…
Browse files Browse the repository at this point in the history
…pr (#1076)"

This reverts commit 9e4721f.
  • Loading branch information
emmileaf authored Nov 3, 2022
1 parent f6a3091 commit b9c011c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ public void visit(TernaryExpr ternaryExpr) {
@Override
public void visit(VariableExpr variableExpr) {
variableExpr.variable().type().accept(this);
annotations(variableExpr.annotations());
if (variableExpr.exprReferenceExpr() != null) {
variableExpr.exprReferenceExpr().accept(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,32 +363,6 @@ public void writeVariableExprImports_nestedReference() {
writerVisitor.write());
}

@Test
public void writeVariableExprImports_withAnnotations() {
Variable variable =
Variable.builder()
.setName("expr")
.setType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class)))
.build();

VariableExpr variableExpr =
VariableExpr.builder()
.setVariable(variable)
.setIsDecl(true)
.setAnnotations(
Arrays.asList(
AnnotationNode.withType(
TypeNode.withReference(ConcreteReference.withClazz(Generated.class)))))
.build();

variableExpr.accept(writerVisitor);
assertEquals(
LineFormatter.lines(
"import com.google.api.generator.engine.ast.Expr;\n",
"import javax.annotation.Generated;\n\n"),
writerVisitor.write());
}

@Test
public void writeAnonymousClassExprImports() {
// [Constructing] Function<List<IOException>, MethodDefinition>
Expand Down

0 comments on commit b9c011c

Please sign in to comment.