Undo leftover experimental AtomicBoolean

This commit is contained in:
Altiami
2024-05-05 09:39:39 -07:00
parent 267c92446b
commit 5fb3a1aadc

View File

@@ -40,7 +40,7 @@ public abstract class BasePluginCompatibility {
/** /**
* Whether the compatibility class has attempted to resolve the reflection references yet or not. * Whether the compatibility class has attempted to resolve the reflection references yet or not.
*/ */
private final AtomicBoolean reflectionResolutionAttempted = new AtomicBoolean(false); private boolean reflectionResolutionAttempted = false;
/** /**
* Define a new compatibility class. * Define a new compatibility class.
@@ -112,7 +112,7 @@ public abstract class BasePluginCompatibility {
*/ */
boolean completePluginCompatibilityCondition(BooleanSupplier conditionCallback) { boolean completePluginCompatibilityCondition(BooleanSupplier conditionCallback) {
synchronized (this) { // compatibility classes are singletons so syncing on itself is safe synchronized (this) { // compatibility classes are singletons so syncing on itself is safe
if (!this.reflectionResolutionAttempted.getAcquire()) { if (!this.reflectionResolutionAttempted) {
var pluginClassLoaders = collectPluginClassLoaders(); var pluginClassLoaders = collectPluginClassLoaders();
if (pluginClassLoaders == null) { if (pluginClassLoaders == null) {
return false; return false;
@@ -125,7 +125,7 @@ public abstract class BasePluginCompatibility {
onPluginClassesNotFound(e); onPluginClassesNotFound(e);
return true; return true;
} finally { } finally {
this.reflectionResolutionAttempted.setRelease(true); this.reflectionResolutionAttempted = true;
} }
NitoriUtil.getPreferredLogger().info(NitoriUtil.makeLogMessage("Resolved reflection references for " + thisClassName + ".")); NitoriUtil.getPreferredLogger().info(NitoriUtil.makeLogMessage("Resolved reflection references for " + thisClassName + "."));
} }