I've found that CFR chooses to omit parentheses in expressions with mixed operators, which may have a negative impact on the code readability and understandability. I think that using parentheses explicitly, especially in the ones with mixed operators might be a helpful improvement. It matches 10.5.1 Parentheses in https://www.oracle.com/java/technologies/javase/codeconventions-contents.html .
Parentheses conventionally serve the purpose of aiding readers in deducing the proper execution order of a given expression. The absence of such parentheses can potentially lead to confusion for readers. As we can see, the original code that makes use of the parentheses brings about relatively more clear meaning. While the code generated by CFR omits the parentheses, resulting in a reduction in both code readability and understandability.
I've found that CFR chooses to omit parentheses in expressions with mixed operators, which may have a negative impact on the code readability and understandability. I think that using parentheses explicitly, especially in the ones with mixed operators might be a helpful improvement. It matches 10.5.1 Parentheses in https://www.oracle.com/java/technologies/javase/codeconventions-contents.html .
Here is an example:
The following code snippet is from org/apache/commons/imaging/common/mylzw/MyBitInputStream.java in the project commons-imaging (commit:92440e4206a12ffd455def326c181058b53b6681):
The corresponding code generated by CFR:
Parentheses conventionally serve the purpose of aiding readers in deducing the proper execution order of a given expression. The absence of such parentheses can potentially lead to confusion for readers. As we can see, the original code that makes use of the parentheses brings about relatively more clear meaning. While the code generated by CFR omits the parentheses, resulting in a reduction in both code readability and understandability.
The corresponding .class file can be found here