Skip to content

Commit 83b36c5

Browse files
committed
chore: DefaultEventSourceManager use containsKey instead of null check to determine if an event source is already registerd
1 parent b9b0317 commit 83b36c5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/DefaultEventSourceManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ public final void registerEventSource(String name, EventSource eventSource) {
4141

4242
try {
4343
lock.lock();
44-
EventSource currentEventSource = eventSources.get(name);
45-
if (currentEventSource != null) {
44+
if (eventSources.containsKey(name)) {
4645
throw new IllegalStateException(
4746
"Event source with name already registered. Event source name: " + name);
4847
}

0 commit comments

Comments
 (0)