Skip to content

Commit fac2d30

Browse files
authored
Merge pull request #158 from evolvedbinary/7.x.x/hotfix/zero-listeners-warning
[7.x.x] Don't log a warning when there are zero listeners
2 parents 1478adf + e1cc017 commit fac2d30

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

exist-core/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,7 @@
976976
<include>src/main/java/org/exist/storage/NativeValueIndex.java</include>
977977
<include>src/main/java/org/exist/storage/NodePath.java</include>
978978
<include>src/test/java/org/exist/storage/NodePathTest.java</include>
979+
<include>src/main/java/org/exist/storage/NotificationService.java</include>
979980
<include>src/main/java/org/exist/storage/ProcessMonitor.java</include>
980981
<include>src/test/java/org/exist/storage/RecoverBinary2Test.java</include>
981982
<include>src/test/java/org/exist/storage/Recovery2Test.java</include>
@@ -1590,6 +1591,7 @@
15901591
<exclude>src/main/java/org/exist/storage/NativeValueIndex.java</exclude>
15911592
<exclude>src/main/java/org/exist/storage/NodePath.java</exclude>
15921593
<exclude>src/test/java/org/exist/storage/NodePathTest.java</exclude>
1594+
<exclude>src/main/java/org/exist/storage/NotificationService.java</exclude>
15931595
<exclude>src/main/java/org/exist/storage/ProcessMonitor.java</exclude>
15941596
<exclude>src/test/java/org/exist/storage/RecoverBinary2Test.java</exclude>
15951597
<exclude>src/test/java/org/exist/storage/RecoverBinaryTest.java</exclude>

exist-core/src/main/java/org/exist/storage/NotificationService.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
* admin@evolvedbinary.com
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -104,7 +128,10 @@ public synchronized void debug() {
104128
@Override
105129
public void shutdown() {
106130
synchronized (this) {
107-
LOG.warn("Expected 0 listeners at shutdown, but {} listeners are still registered", listeners.size());
131+
final int remainingListeners = listeners.size();
132+
if (remainingListeners > 0) {
133+
LOG.warn("Expected 0 listeners at shutdown, but {} listeners are still registered", remainingListeners);
134+
}
108135
}
109136
BrokerPoolService.super.shutdown();
110137
}

0 commit comments

Comments
 (0)