The following code has a null guard for the _rsCfg argument, but the argument is used in both guarded and unguarded contexts:
ReceivingService(ReceivingServiceConfig _rsCfg) {
ReceivingServiceConfig rsCfg = Optional.ofNullable(_rsCfg).orElse(ReceivingServiceConfigBuilder.getDefaultConfig());
executors.put(ExecutorNames.SIGNAL, Executors.newFixedThreadPool(rsCfg.getSignalThreadPoolSize(), new NameableThreadFactory("DBus-Signal-Receiver-", true)));
executors.put(ExecutorNames.ERROR, Executors.newFixedThreadPool(rsCfg.getErrorThreadPoolSize(), new NameableThreadFactory("DBus-Error-Receiver-", true)));
// we need multiple threads here so recursive method calls are possible
executors.put(ExecutorNames.METHODCALL, Executors.newFixedThreadPool(rsCfg.getMethodCallThreadPoolSize(), new NameableThreadFactory("DBus-MethodCall-Receiver-", true)));
executors.put(ExecutorNames.METHODRETURN, Executors.newFixedThreadPool(rsCfg.getMethodReturnThreadPoolSize(), new NameableThreadFactory("DBus-MethodReturn-Receiver-", true)));
retryHandler = _rsCfg.getRetryHandler();
}
The deprecated DirectConnection constructor passes in a null configuration, as per:
public DirectConnection(String _address, int _timeout) throws DBusException {
this(createTransportConfig(_address, _timeout), null);
}
The following code has a
null
guard for the_rsCfg
argument, but the argument is used in both guarded and unguarded contexts:The deprecated
DirectConnection
constructor passes in anull
configuration, as per:That
null
configuration is then passed along to:Then passed to
ReceivingService
via its constructor:This means that the following line can throw a
NullPointerException
:Is this supposed to be called without the
_
to use thenull
-safe variable? Such as: