aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/java/com/google/googlejavaformat/java/JavaOutput.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/com/google/googlejavaformat/java/JavaOutput.java')
-rw-r--r--core/src/main/java/com/google/googlejavaformat/java/JavaOutput.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/java/com/google/googlejavaformat/java/JavaOutput.java b/core/src/main/java/com/google/googlejavaformat/java/JavaOutput.java
index c43a91a..656b65c 100644
--- a/core/src/main/java/com/google/googlejavaformat/java/JavaOutput.java
+++ b/core/src/main/java/com/google/googlejavaformat/java/JavaOutput.java
@@ -111,7 +111,7 @@ public final class JavaOutput extends Output {
* there's a blank line here and it's a comment.
*/
BlankLineWanted wanted = blankLines.getOrDefault(lastK, BlankLineWanted.NO);
- if (isComment(text) ? sawNewlines : wanted.wanted().orElse(sawNewlines)) {
+ if ((sawNewlines && isComment(text)) || wanted.wanted().orElse(sawNewlines)) {
++newlinesPending;
}
}