Remove Map null annotation workarounds (#8916)

These workarounds to prevent false positives can be removed now the EEAs allow for proper null analysis.

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2020-11-04 13:57:24 +01:00
committed by GitHub
parent 1dccf67909
commit b423f93b1f
124 changed files with 315 additions and 387 deletions

View File

@@ -28,28 +28,22 @@ import com.daveoxley.cbus.CGateThreadPoolExecutor;
*
* @author John Harvey - Initial contribution
*/
@NonNullByDefault
public class CBusThreadPool extends CGateThreadPool {
private final Map<String, @Nullable CGateThreadPoolExecutor> executorMap = new HashMap<>();
private final Map<String, CGateThreadPoolExecutor> executorMap = new HashMap<>();
@Override
protected synchronized CGateThreadPoolExecutor CreateExecutor(@Nullable String name) {
if (name == null || name.isEmpty()) {
name = "_default";
String nullSafeName = name == null || name.isEmpty() ? "_default" : name;
CGateThreadPoolExecutor executor = executorMap.get(nullSafeName);
if (executor == null) {
executor = new CBusThreadPoolExecutor(nullSafeName);
executorMap.put(nullSafeName, executor);
}
@Nullable
CGateThreadPoolExecutor executor = executorMap.get(name);
if (executor != null) {
return executor;
}
CGateThreadPoolExecutor newExecutor = new CBusThreadPoolExecutor(name);
executorMap.put(name, newExecutor);
return newExecutor;
return executor;
}
@NonNullByDefault
public class CBusThreadPoolExecutor extends CGateThreadPoolExecutor {
private final ThreadPoolExecutor threadPool;