RFR: 7903711: Rewrite simple methods ANC plugin to classfile API [v2]
Leonid Kuskov
lkuskov at openjdk.org
Mon Apr 15 18:50:14 UTC 2024
On Mon, 15 Apr 2024 18:20:11 GMT, Alexandre Iline <shurailine at openjdk.org> wrote:
>> plugins/simple_methods_anc/src/openjdk/jcov/filter/simplemethods/Delegators.java line 59:
>>
>>> 57: var iter = new InstructionIterator(m.code().get());
>>> 58: var next = iter.next(i -> !isSimpleInstruction(i.opcode()));
>>> 59: if (next == null || !isInvokeInstruction(next.opcode())) return false;
>>
>> Bad codestyle - the line should be splitted into 2 ones.
>>
>> if (next == null || !isInvokeInstruction(next.opcode()))
>> return false;
>
> I think OpenJDK style is to only not use curly brackets in statement is on the same line as the if. If the statement is on another line, you were supposed to use the curly brackets. I do not remember where I saw this.
Jcov uses '2-lines' if statements in many places, which, although more readable, is incorrect. The OpenJDK Java code style recommends using curly braces syntax instead - [https://cr.openjdk.org/~alundblad/styleguide/index-v6.html#toc-braces](https://cr.openjdk.org/~alundblad/styleguide/index-v6.html#toc-braces)
-------------
PR Review Comment: https://git.openjdk.org/jcov/pull/44#discussion_r1566286293
More information about the jcov-dev
mailing list