RFR: 1478: Add metrics and loggin measuring time before WorkItems start to run [v2]
Erik Joelsson
erikj at openjdk.java.net
Wed Jun 15 11:15:26 UTC 2022
On Tue, 14 Jun 2022 16:40:07 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Added comment
>
> bot/src/main/java/org/openjdk/skara/bot/BotRunner.java line 68:
>
>> 66: */
>> 67: private static class PendingWorkItem {
>> 68: private final WorkItem item;
>
> Maybe I'm a bit old-fashioned, but I think it looks a bit strange to have private fields but no accesses to them from within the class. (I was actually a bit surprised when I realized an outer class can access private fields in a static nested class...)
>
> I'm thinking either:
> 1) create getters
> 2) declare the fields public, or
> 3) mabe even consider if this should be a record.
I actually think this is completely fine. The private fields can only be accessed within this java source file, so there is no risk of messing things up for unknown clients in the future. Adding extra boilerplate seems unnecessary to me. The fields should definitely not be public IMO.
Maybe this would qualify as a record, but I don't think we have started using them in Skara yet. I'm also not sure I want the automatically generated equals and hashcode from a record on this class. It works well with the default Object.hashcode().
-------------
PR: https://git.openjdk.org/skara/pull/1337
More information about the skara-dev
mailing list