Skip to content

Commit 5e114ca

Browse files
TimvdLippecushon
authored andcommitted
Do not crash when encountering double semi-colon after package statement
MOE_MIGRATED_REVID=240588095
1 parent 9b0f032 commit 5e114ca

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ public Void visitCompilationUnit(CompilationUnitTree node, Void unused) {
347347
builder.forcedBreak();
348348
first = false;
349349
}
350+
dropEmptyDeclarations();
350351
if (!node.getImports().isEmpty()) {
351352
if (!first) {
352353
builder.blankLineWanted(BlankLineWanted.YES);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package foo;;
2+
3+
import com.google.second.Foo;
4+
import com.google.first.Bar;
5+
6+
public class Blim {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package foo;
2+
;
3+
import com.google.second.Foo;
4+
import com.google.first.Bar;
5+
6+
public class Blim {}

0 commit comments

Comments
 (0)