Actually, yes I think so. Integer.compare
calls Integer.valueOf
two times, generating two objects in the process just to execute a statement similar to the one I wrote.
But, to your credit, I…
Because I got rid of the IEvent
interface so that every object can be used as an event.
It would, but Objects.requireNonNull
makes it immediately obvious to the caller that the parameter has to be non-null. I agree that it doesn't make much of the difference, but as it's handled like…
But isn't that what we want to achieve? A dedicated event listener would not necessarily be referenced from other classes apart from EventBus
. Also, EventBus
allows the deletion of event…
I coould, but this would mix the actual logic of the method with the logging and bloat up the line.