Skip to content

Commit

Permalink
Format long exception lists one-per-line
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 486955708
  • Loading branch information
cushon authored and google-java-format Team committed Nov 8, 2022
1 parent dda4321 commit 198fa42
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2639,7 +2639,7 @@ private void visitThrowsClause(List<? extends ExpressionTree> thrownExceptionTyp
for (ExpressionTree thrownExceptionType : thrownExceptionTypes) {
if (!first) {
token(",");
builder.breakToFill(" ");
builder.breakOp(" ");
}
scan(thrownExceptionType, null);
first = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ class M {

/** JavaDoc. */
void methodName3(int x)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5, Exception6,
Exception7, Exception8, Exception9 {}
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {}

/** JavaDoc. */
void methodName4(
Expand Down Expand Up @@ -114,8 +122,16 @@ class M {
int t,
int u,
int v)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5, Exception6,
Exception7, Exception8, Exception9 {}
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {}

Pair<
Pair<Pair<Pair<T, T>, Pair<T, T>>, Pair<Pair<T, T>, Pair<T, T>>>,
Expand All @@ -135,8 +151,16 @@ class M {
Pair<Pair<Pair<T, T>, Pair<T, T>>, Pair<Pair<T, T>, Pair<T, T>>>,
Pair<Pair<Pair<T, T>, Pair<T, T>>, Pair<Pair<T, T>, Pair<T, T>>>>
methodName11(int x)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5, Exception6,
Exception7, Exception8, Exception9 {
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {
return null;
}

Expand Down Expand Up @@ -225,8 +249,16 @@ class M {
int t,
int u,
int v)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5, Exception6,
Exception7, Exception8, Exception9 {
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {
return null;
}

Expand Down Expand Up @@ -338,8 +370,16 @@ class M {
T30,
T31>
T methodName22(int x)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5, Exception6,
Exception7, Exception8, Exception9 {
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {
return null;
}

Expand Down Expand Up @@ -518,8 +558,16 @@ class M {
int t,
int u,
int v)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5, Exception6,
Exception7, Exception8, Exception9 {
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {
return null;
}

Expand Down Expand Up @@ -640,8 +688,16 @@ class M {
Pair<Pair<Pair<T, T>, Pair<T, T>>, Pair<Pair<T, T>, Pair<T, T>>>,
Pair<Pair<Pair<T, T>, Pair<T, T>>, Pair<Pair<T, T>, Pair<T, T>>>>
methodName(int x)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5,
Exception6, Exception7, Exception8, Exception9 {
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {
return null;
}

Expand Down Expand Up @@ -829,8 +885,16 @@ class M {
int t,
int u,
int v)
throws Exception0, Exception1, Exception2, Exception3, Exception4, Exception5,
Exception6, Exception7, Exception8, Exception9 {
throws Exception0,
Exception1,
Exception2,
Exception3,
Exception4,
Exception5,
Exception6,
Exception7,
Exception8,
Exception9 {
return null;
}

Expand Down Expand Up @@ -1011,6 +1075,14 @@ class M {
ZZZZZZZZZZ z,
ZZZZZZZZZZ z,
ZZZZZZZZZZ z)
throws EEEEEEEEEE, EEEEEEEEEE, EEEEEEEEEE, EEEEEEEEEE, EEEEEEEEEE, EEEEEEEEEE, EEEEEEEEEE,
EEEEEEEEEE, EEEEEEEEEE, EEEEEEEEEE {}
throws EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE,
EEEEEEEEEE {}
}

0 comments on commit 198fa42

Please sign in to comment.