RFR: 7903711: Rewrite simple methods ANC plugin to classfile API [v2]
Alexandre Iline
shurailine at openjdk.org
Mon Apr 15 18:46:00 UTC 2024
On Mon, 15 Apr 2024 18:40:43 GMT, Alexandre Iline <shurailine at openjdk.org> wrote:
>> plugins/simple_methods_anc/src/openjdk/jcov/filter/simplemethods/EmptyMethods.java line 38:
>>
>>> 36: public boolean test(ClassModel node, MethodModel m) {
>>> 37: if (m.code().isPresent()) {
>>> 38: var next = new InstructionIterator(m.code().get()).next(i -> !isSimpleInstruction(i.opcode()));
>>
>> Bad practice to use var in "shared" projects except tests - a human isn't javac, for readability it would be much better to see a type of the result.
>
> I am happy to follow any coding guidelines. Was there an update to the openjdk guidelines in regards to the new language features? This code uses multiple new language features, I do not immediately see why "var" should be an exception.
I am however updating all the cases where the type is non-obvious - that point is IMO valid.
-------------
PR Review Comment: https://git.openjdk.org/jcov/pull/44#discussion_r1566282430
More information about the jcov-dev
mailing list