diff --git a/platform/util/src/com/intellij/openapi/util/AtomicNullableLazyValue.java b/platform/util/src/com/intellij/openapi/util/AtomicNullableLazyValue.java index e17de2508170..08d592b65ed1 100644 --- a/platform/util/src/com/intellij/openapi/util/AtomicNullableLazyValue.java +++ b/platform/util/src/com/intellij/openapi/util/AtomicNullableLazyValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,9 @@ package com.intellij.openapi.util; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + /** * @author peter */ @@ -46,4 +49,16 @@ public abstract class AtomicNullableLazyValue extends NullableLazyValue { } return value; } + + @SuppressWarnings("MethodOverridesStaticMethodOfSuperclass") + @NotNull + public static AtomicNullableLazyValue createValue(@NotNull final Factory value) { + return new AtomicNullableLazyValue() { + @Nullable + @Override + protected T compute() { + return value.create(); + } + }; + } }