Also, without the final there's a potential race-condition if executors could have ever been set to null (or could do so in future versions) in a multi-threaded environment. Simply returning is less confusing/misleading. If you want to ensure there's no null, how about adding an assert that gets optimized away when building a production version?
Is the check for
null
superfluous?https://github.com/hypfvieh/dbus-java/blob/deeda69cba75aa25b47e047ce59aa7403677a1e8/dbus-java-core/src/main/java/org/freedesktop/dbus/connections/ReceivingService.java#L154
Because the map is
final
?https://github.com/hypfvieh/dbus-java/blob/deeda69cba75aa25b47e047ce59aa7403677a1e8/dbus-java-core/src/main/java/org/freedesktop/dbus/connections/ReceivingService.java#L31
Also, without the
final
there's a potential race-condition ifexecutors
could have ever been set tonull
(or could do so in future versions) in a multi-threaded environment. Simply returning is less confusing/misleading. If you want to ensure there's nonull
, how about adding anassert
that gets optimized away when building a production version?