Skip to content

Commit 400ea11

Browse files
committed
Bug 37872354 - [37724206->22.06.13] NPE in Daemon.changeState() due to Daemon.getContext() unexpectedly NULL. (v14.1.1.2206->ce-2206)
Remote remote.full on coherence-ce/release/coherence-ce-v22.06 success, changes 115924, synced @115924, job.9.20250425152553.1169 [git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v22.06/": change = 115943]
1 parent 29f2c3b commit 400ea11

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

prj/coherence-core/src/main/java/com/tangosol/net/GuardSupport.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -645,8 +645,11 @@ public int getState()
645645
public void release()
646646
{
647647
Guardable guardable = getGuardable();
648-
guardable.setContext(null);
649-
GuardSupport.this.remove(guardable);
648+
if (guardable != null)
649+
{
650+
guardable.setContext(null);
651+
GuardSupport.this.remove(guardable);
652+
}
650653
}
651654

652655
/**

prj/coherence-core/src/main/java/com/tangosol/util/Daemon.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
5-
* http://oss.oracle.com/licenses/upl.
5+
* https://oss.oracle.com/licenses/upl.
66
*/
77

88
package com.tangosol.util;
@@ -636,9 +636,10 @@ protected synchronized void changeState(int nState, DaemonWorker worker)
636636
m_nState = STATE_STOPPED;
637637

638638
// release the GuardContext if this Daemon is being guarded
639-
if (isGuarded())
639+
Guardian.GuardContext ctx = getContext();
640+
if (ctx != null)
640641
{
641-
getContext().release();
642+
ctx.release();
642643
GuardSupport.setThreadContext(null);
643644
}
644645
}

0 commit comments

Comments
 (0)