<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/unittests/Format/FormatTestJava.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[clang-format] Fix brace wrapping for Java records (#164711)</title>
<updated>2025-11-05T19:55:32+00:00</updated>
<author>
<name>Hannes Braun</name>
<email>hannes@hannesbraun.net</email>
</author>
<published>2025-11-05T19:55:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6c4f9688082361a5c5d57aa1e6d368dfc4aeea75'/>
<id>6c4f9688082361a5c5d57aa1e6d368dfc4aeea75</id>
<content type='text'>
The brace wrapping for Java records should now behave similar to
classes. Before, opening braces for Java records were always placed in
the same line as the record definition.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The brace wrapping for Java records should now behave similar to
classes. Before, opening braces for Java records were always placed in
the same line as the record definition.
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Remove special handling of comments after brace/paren (#71672)</title>
<updated>2025-10-18T22:25:28+00:00</updated>
<author>
<name>Björn Schäpers</name>
<email>bjoern@hazardy.de</email>
</author>
<published>2025-10-18T22:25:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cf28a476fb0fae2b19112ce0532b308e79d7bf39'/>
<id>cf28a476fb0fae2b19112ce0532b308e79d7bf39</id>
<content type='text'>
Fixes http://llvm.org/PR55487 (#55487)

The code did not match the documentation about Cpp11BracedListStyle.
Changed handling of comments after opening braces, which are supposedly
function call like to behave exactly like their parenthesis counter
part.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes http://llvm.org/PR55487 (#55487)

The code did not match the documentation about Cpp11BracedListStyle.
Changed handling of comments after opening braces, which are supposedly
function call like to behave exactly like their parenthesis counter
part.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Clean up around StringRef initializations (#149765)</title>
<updated>2025-07-22T02:11:17+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-07-22T02:11:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d48996ff05305d4a5774f3e232c2ee4a06c3d2a'/>
<id>4d48996ff05305d4a5774f3e232c2ee4a06c3d2a</id>
<content type='text'>
Consistently use `constexpr StringRef Code("string literal");`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Consistently use `constexpr StringRef Code("string literal");`.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Handle Java text blocks (#141334)</title>
<updated>2025-05-25T22:40:45+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-05-25T22:40:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b7f5950bb3b97eac979925a3bbf015530c26962e'/>
<id>b7f5950bb3b97eac979925a3bbf015530c26962e</id>
<content type='text'>
Fix #61954</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix #61954</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Handle C++ keywords in other languages better (#132941)</title>
<updated>2025-04-10T12:51:10+00:00</updated>
<author>
<name>sstwcw</name>
<email>su3e8a96kzlver@posteo.net</email>
</author>
<published>2025-04-10T12:51:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ed858220276dd11f6c2d7a5d3e357c211f9c6190'/>
<id>ed858220276dd11f6c2d7a5d3e357c211f9c6190</id>
<content type='text'>
There is some code to make sure that C++ keywords that are identifiers
in the other languages are not treated as keywords.  Right now, the kind
is set to identifier, and the identifier info is cleared.  The latter is
probably so that the code for identifying C++ structures does not
recognize those structures by mistake when formatting a language that
does not have those structures.  But we did not find an instance where
the language can have the sequence of tokens, the code tries to parse
the structure as if it is C++ using the identifier info instead of the
token kind, but without checking for the language setting.  However,
there are places where the code checks whether the identifier info field
is null or not.  They are places where an identifier and a keyword are
treated the same way.  For example, the name of a function in
JavaScript.  This patch removes the lines that clear the identifier
info.  This way, a C++ keyword gets treated in the same way as an
identifier in those places.

JavaScript

New

```JavaScript
async function
union(
    myparamnameiswaytooloooong) {
}
```

Old

```JavaScript
async function
    union(
        myparamnameiswaytooloooong) {
}
```

Java

New

```Java
enum union { ABC, CDE }
```

Old

```Java
enum
union { ABC, CDE }
```

This reverts commit 97dcbdef6089175c45e14fcbcf5c88b10233a79a.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is some code to make sure that C++ keywords that are identifiers
in the other languages are not treated as keywords.  Right now, the kind
is set to identifier, and the identifier info is cleared.  The latter is
probably so that the code for identifying C++ structures does not
recognize those structures by mistake when formatting a language that
does not have those structures.  But we did not find an instance where
the language can have the sequence of tokens, the code tries to parse
the structure as if it is C++ using the identifier info instead of the
token kind, but without checking for the language setting.  However,
there are places where the code checks whether the identifier info field
is null or not.  They are places where an identifier and a keyword are
treated the same way.  For example, the name of a function in
JavaScript.  This patch removes the lines that clear the identifier
info.  This way, a C++ keyword gets treated in the same way as an
identifier in those places.

JavaScript

New

```JavaScript
async function
union(
    myparamnameiswaytooloooong) {
}
```

Old

```JavaScript
async function
    union(
        myparamnameiswaytooloooong) {
}
```

Java

New

```Java
enum union { ABC, CDE }
```

Old

```Java
enum
union { ABC, CDE }
```

This reverts commit 97dcbdef6089175c45e14fcbcf5c88b10233a79a.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[clang-format] Handle C++ keywords in other languages better (#132941)"</title>
<updated>2025-04-02T01:59:12+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2025-04-02T01:56:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=97dcbdef6089175c45e14fcbcf5c88b10233a79a'/>
<id>97dcbdef6089175c45e14fcbcf5c88b10233a79a</id>
<content type='text'>
This reverts commit ab7cee8a0ecf29fdb47c64c8d431a694d63390d2 which had
formatting errors.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit ab7cee8a0ecf29fdb47c64c8d431a694d63390d2 which had
formatting errors.
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Handle C++ keywords in other languages better (#132941)</title>
<updated>2025-03-31T13:54:49+00:00</updated>
<author>
<name>sstwcw</name>
<email>su3e8a96kzlver@posteo.net</email>
</author>
<published>2025-03-25T14:10:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ab7cee8a0ecf29fdb47c64c8d431a694d63390d2'/>
<id>ab7cee8a0ecf29fdb47c64c8d431a694d63390d2</id>
<content type='text'>
There is some code to make sure that C++ keywords that are identifiers
in the other languages are not treated as keywords.  Right now, the kind
is set to identifier, and the identifier info is cleared.  The latter is
probably so that the code for identifying C++ structures does not
recognize those structures by mistake when formatting a language that
does not have those structures.  But we did not find an instance where
the language can have the sequence of tokens, the code tries to parse
the structure as if it is C++ using the identifier info instead of the
token kind, but without checking for the language setting.  However,
there are places where the code checks whether the identifier info field
is null or not.  They are places where an identifier and a keyword are
treated the same way.  For example, the name of a function in
JavaScript.  This patch removes the lines that clear the identifier
info.  This way, a C++ keyword gets treated in the same way as an
identifier in those places.

JavaScript

New

```JavaScript
async function
union(
    myparamnameiswaytooloooong) {
}
```

Old

```JavaScript
async function
    union(
        myparamnameiswaytooloooong) {
}
```

Java

New

```Java
enum union { ABC, CDE }
```

Old

```Java
enum
union { ABC, CDE }
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is some code to make sure that C++ keywords that are identifiers
in the other languages are not treated as keywords.  Right now, the kind
is set to identifier, and the identifier info is cleared.  The latter is
probably so that the code for identifying C++ structures does not
recognize those structures by mistake when formatting a language that
does not have those structures.  But we did not find an instance where
the language can have the sequence of tokens, the code tries to parse
the structure as if it is C++ using the identifier info instead of the
token kind, but without checking for the language setting.  However,
there are places where the code checks whether the identifier info field
is null or not.  They are places where an identifier and a keyword are
treated the same way.  For example, the name of a function in
JavaScript.  This patch removes the lines that clear the identifier
info.  This way, a C++ keyword gets treated in the same way as an
identifier in those places.

JavaScript

New

```JavaScript
async function
union(
    myparamnameiswaytooloooong) {
}
```

Old

```JavaScript
async function
    union(
        myparamnameiswaytooloooong) {
}
```

Java

New

```Java
enum union { ABC, CDE }
```

Old

```Java
enum
union { ABC, CDE }
```
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] Handle Java switch expressions (#91112)</title>
<updated>2024-05-07T02:55:55+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2024-05-07T02:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=236b3e1aad45e2bab8ede0da6397b7b01f9cc9d8'/>
<id>236b3e1aad45e2bab8ede0da6397b7b01f9cc9d8</id>
<content type='text'>
Also adds AllowShortCaseExpressionOnASingleLine option and
AlignCaseArrows suboption of AlignConsecutiveShortCaseStatements.

Fixes #55903.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also adds AllowShortCaseExpressionOnASingleLine option and
AlignCaseArrows suboption of AlignConsecutiveShortCaseStatements.

Fixes #55903.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format] SpacesInSquareBrackets not working for Java (#77833)</title>
<updated>2024-01-12T08:30:53+00:00</updated>
<author>
<name>MyDeveloperDay</name>
<email>mydeveloperday@gmail.com</email>
</author>
<published>2024-01-12T08:30:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c65b939fb795ce4688d33531341d460a47d16664'/>
<id>c65b939fb795ce4688d33531341d460a47d16664</id>
<content type='text'>
spaces in [] needs to be handled the same in Java the same as C#.

Co-authored-by: paul_hoad &lt;paul_hoad@amat.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
spaces in [] needs to be handled the same in Java the same as C#.

Co-authored-by: paul_hoad &lt;paul_hoad@amat.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-format][NFC] Remove extraneous newlines in some unit test files</title>
<updated>2023-10-27T04:43:27+00:00</updated>
<author>
<name>Owen Pan</name>
<email>owenpiano@gmail.com</email>
</author>
<published>2023-10-27T04:41:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=88934a82dced0116227e4ad9af8896d8fa0943b8'/>
<id>88934a82dced0116227e4ad9af8896d8fa0943b8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
