Skip to content

Commit 95c738a

Browse files
committed
Cover two more text blocks that settled only on a second run
A text block that is a method argument with more arguments after it, and a text block in each branch of a ternary, came out of one run at one indentation and out of the next at another. The inputs come from google/google-java-format#805 and google/google-java-format#1378, where they show other symptoms; the first is also the shape of java/lang/Module.java, the one JDK 21 file the fixed point changes. With the string wrapping pass run to a fixed point, one run gives the second result; without it, both new goldens fail (#34).
1 parent e2c90fd commit 95c738a

4 files changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class T {
2+
void f() {
3+
LOGGER.warning(String.format("""
4+
@Gauge is configured on a bean %s that is neither ApplicationScoped nor \
5+
Singleton. This is most likely a bug. You may set 'metrics.warn-dependent' \
6+
configuration option to 'false' to remove this warning.""", clazz.getName()));
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class T {
2+
void f() {
3+
LOGGER.warning(String.format("""
4+
@Gauge is configured on a bean %s that is neither ApplicationScoped nor \
5+
Singleton. This is most likely a bug. You may set 'metrics.warn-dependent' \
6+
configuration option to 'false' to remove this warning.\
7+
""", clazz.getName()));
8+
}
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class TernaryBug {
2+
boolean flag = true;
3+
4+
String a = flag
5+
? """
6+
yes
7+
"""
8+
: """
9+
no
10+
""";
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class TernaryBug {
2+
boolean flag = true;
3+
4+
String a = flag ? """
5+
yes
6+
""" : """
7+
no
8+
""";
9+
}

0 commit comments

Comments
 (0)