diff --git a/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java b/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java index 7a0dde3cd..9ff42cce6 100644 --- a/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java +++ b/core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java @@ -3686,15 +3686,15 @@ protected int declareOne( builder.open(ZERO); { visitAnnotations(annotations, BreakOrNot.NO, BreakOrNot.YES); - if (typeWithDims.isPresent() && typeWithDims.get().node != null) { + if (isVar) { + token("var"); + } else if (typeWithDims.isPresent() && typeWithDims.get().node != null) { scan(typeWithDims.get().node, null); int totalDims = dims.size(); builder.open(plusFour); maybeAddDims(dims); builder.close(); baseDims = totalDims - dims.size(); - } else if (isVar) { - token("var"); } else { scan(type, null); }