Bug: Incorrect lazy initialization of static field

org.eclipse.help.internal.criteria.CriteriaProviderRegistry.instance in
org.eclipse.help.internal.criteria.CriteriaProviderRegistry.getInstance()

This method contains an unsynchronized lazy initialization of a
non-volatile static field. Because the compiler or processor may reorder
instructions, threads are not guaranteed to see a completely initialized
object, if the method can be called by multiple threads. You can make
the field volatile to correct the problem. For more information, see the
Java Memory Model web site.

Rank: Troubling (14), confidence: Normal
Pattern: LI_LAZY_INIT_STATIC
Type: LI, Category: MT_CORRECTNESS (Multithreaded correctness)

Change-Id: Ie3f80610a6bf944971c40108f7c5a0512c7550d4
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ua/+/173461
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
1 file changed