From eafeca43268f16aa9d4a179e44b9e7747699c1eb Mon Sep 17 00:00:00 2001 From: pascalschumacher Date: Tue, 25 Oct 2016 00:40:48 +0200 Subject: [PATCH] LANG-1144: Multiple calls of org.apache.commons.lang3.concurrent.LazyInitializer.initialize() are possible use all uppercase name for constant --- .../apache/commons/lang3/concurrent/LazyInitializer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java index ed840498d..2b2f72d23 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java @@ -79,11 +79,11 @@ package org.apache.commons.lang3.concurrent; */ public abstract class LazyInitializer implements ConcurrentInitializer { - private static final Object noInit = new Object(); + private static final Object NO_INIT = new Object(); @SuppressWarnings("unchecked") /** Stores the managed object. */ - private volatile T object = (T) noInit; + private volatile T object = (T) NO_INIT; /** * Returns the object wrapped by this instance. On first access the object @@ -99,10 +99,10 @@ public abstract class LazyInitializer implements ConcurrentInitializer { // volatile field T result = object; - if (result == noInit) { + if (result == NO_INIT) { synchronized (this) { result = object; - if (result == noInit) { + if (result == NO_INIT) { object = result = initialize(); } }