RFR: 1478: Add metrics and loggin measuring time before WorkItems start to run [v2]

Magnus Ihse Bursie ihse at openjdk.java.net
Wed Jun 15 14:01:54 UTC 2022


On Wed, 15 Jun 2022 11:12:23 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> 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().

Ok.

-------------

PR: https://git.openjdk.org/skara/pull/1337


More information about the skara-dev mailing list