public ClsTypeElementImpl(@NotNull PsiElement parent, @NotNull String typeText, char variance) { myParent = parent; myTypeText = TypeInfo.internFrequentType(typeText); myVariance = variance; myChild = new AtomicNullableLazyValue<ClsElementImpl>() { @Override protected ClsElementImpl compute() { return calculateChild(); } }; myCachedType = new AtomicNotNullLazyValue<PsiType>() { @NotNull @Override protected PsiType compute() { return calculateType(); } }; }
public ClsPackageAccessibilityStatementImpl(PsiPackageAccessibilityStatementStub stub) { super(stub); myPackageReference = new AtomicNullableLazyValue<PsiJavaCodeReferenceElement>() { @Override protected PsiJavaCodeReferenceElement compute() { String packageName = getPackageName(); return packageName != null ? new ClsJavaCodeReferenceElementImpl(ClsPackageAccessibilityStatementImpl.this, packageName) : null; } }; myModuleReferences = new AtomicNotNullLazyValue<Iterable<PsiJavaModuleReferenceElement>>() { @NotNull @Override protected Iterable<PsiJavaModuleReferenceElement> compute() { return ContainerUtil.map(getStub().getTargets(), target -> new ClsJavaModuleReferenceElementImpl(ClsPackageAccessibilityStatementImpl.this, target)); } }; }