RFR: StateObjectHandler.validateState(): fix typo and optimize
Aleksey Shipilev
shade at openjdk.java.net
Thu Oct 22 13:55:14 UTC 2020
On Thu, 22 Oct 2020 10:22:17 GMT, Sergey Ponomarev <github.com+415502+stokito at openjdk.org> wrote:
> Last commit contains extract of two methods from duplicated code that IntelliJ found. Not sure if this change has any value for you so I can revert it
It might be a good cleanup. However, the style is usually to return `Collection<String>`, and then do e.g.:
for (String s : addStateInitializersParamsLabels(so)) writer.println(ident(1) + s);
...and remove the indents from the helper methods. That way we can make sure indenting in the generated code is fine. (You might want to check it with your own eyes anyway).
jmh-core/src/main/java/org/openjdk/jmh/generators/core/StateObjectHandler.java line 780:
> 778: }
> 779: }
> 780: addStateInitializersHelpers(result, so);
Shouldn't the block above also be replaced with `addStateInitializersParamsLabels`?
-------------
Changes requested by shade (Committer).
PR: https://git.openjdk.java.net/jmh/pull/7
More information about the jmh-dev
mailing list