<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61557>61557</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format does not handle array of anonymous inner classes in Java correctly.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ZequanWu
</td>
</tr>
</table>
<pre>
```
public class A {
class B {
int a;
int b;
}
void foo() {
B[] array = {new B(){{ a = 1; b = 2;}}};
}
void bar() {
foo();
}
}
```
After:
```
public class A {
class B {
int a;
int b;
}
void foo() {
B[] array = {new B(){{a = 1;
b = 2;
}
}
}
;
}
void bar() {
foo();
}
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU02P2yAQ_TX4MtoID3EcHzjEinLoH6jU22BPEioCKeBU-feVE28-utlKWwuJ4cGbN_MMlJLdeWYtqlZU64KGvA9R_-BfA_nvQ2FCf9ZiIach10KujoNxtoPOUUqwAlG3VxwAJrB9BsfP-gwk1AvUPKGiXk-LU7A9bEMQuBTYfMzYXksGipHOINR6POL5N7RXxkioW6DLVilUC-YS4qhXr6dx074LA1y1DcXPtG9lveDfg2fbVtvMUajVy82vefp1M997evITplL-w9a7q8_sB4s_teUWvB-6If-y_aPljxkB_rK16LXqG9VQwbpc1I2aq6WUxV43NTcocV4pklTyspNmuzSVYkU1KtUVVqNEJRXKcUY568yyLBm5MmqhFjWLueQDWTdz7nSYhbgrbEoD60VZVXXhyLBLl_eE2Dnyu7dtiAfKAnF8YVGPtDcz7JKYS2dTTvdE2WbH-pEFfeAEPmTYk-8dT_8lbIF88OdDGBJY7zlerwmPK_hGJ4IuxMhdducZFEN0ep_zMY33DzcCNzub94OZdeEgcDPqT9PbMYaf3GWBm0tXSeDm0tifAAAA__-NKRWG">