From e7ea3d96679a364360e90cd8d58097757b9d20d5 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 23 Jan 2013 14:21:05 +0400 Subject: [PATCH] LazyValue renamed to avoid confusion --- .../descriptors/TypeParameterDescriptorImpl.java | 4 ++-- .../jet/lang/resolve/DescriptorResolver.java | 12 ++++++------ .../org/jetbrains/jet/lang/resolve/TypeResolver.java | 4 ++-- .../jet/lang/resolve/lazy/LazyClassMemberScope.java | 4 ++-- .../resolve/lazy/LazyTypeParameterDescriptor.java | 4 ++-- .../jet/lang/resolve/scopes/LazyScopeAdapter.java | 6 +++--- .../org/jetbrains/jet/lang/types/DeferredType.java | 8 ++++---- .../expressions/ClosureExpressionsTypingVisitor.java | 4 ++-- ...yValue.java => RecursionIntolerantLazyValue.java} | 2 +- ... => RecursionIntolerantLazyValueWithDefault.java} | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) rename compiler/frontend/src/org/jetbrains/jet/util/lazy/{LazyValue.java => RecursionIntolerantLazyValue.java} (96%) rename compiler/frontend/src/org/jetbrains/jet/util/lazy/{LazyValueWithDefault.java => RecursionIntolerantLazyValueWithDefault.java} (82%) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptorImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptorImpl.java index 66047120658..a51ad9e607a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptorImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptorImpl.java @@ -26,7 +26,7 @@ import org.jetbrains.jet.lang.types.*; import org.jetbrains.jet.lang.types.checker.JetTypeChecker; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; import org.jetbrains.jet.renderer.DescriptorRenderer; -import org.jetbrains.jet.util.lazy.LazyValue; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValue; import java.util.Collections; import java.util.List; @@ -218,7 +218,7 @@ public class TypeParameterDescriptorImpl extends DeclarationDescriptorNonRootImp getTypeConstructor(), TypeUtils.hasNullableLowerBound(this), Collections.emptyList(), - new LazyScopeAdapter(new LazyValue() { + new LazyScopeAdapter(new RecursionIntolerantLazyValue() { @Override protected JetScope compute() { return getUpperBoundsAsType().getMemberScope(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorResolver.java index 1c65e11ec07..fe922cc0782 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorResolver.java @@ -39,8 +39,8 @@ import org.jetbrains.jet.lang.types.checker.JetTypeChecker; import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; import org.jetbrains.jet.lexer.JetTokens; -import org.jetbrains.jet.util.lazy.LazyValue; -import org.jetbrains.jet.util.lazy.LazyValueWithDefault; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValue; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValueWithDefault; import javax.inject.Inject; import java.util.*; @@ -289,7 +289,7 @@ public class DescriptorResolver { final JetExpression bodyExpression = function.getBodyExpression(); if (bodyExpression != null) { returnType = - DeferredType.create(trace, new LazyValueWithDefault(ErrorUtils.createErrorType("Recursive dependency")) { + DeferredType.create(trace, new RecursionIntolerantLazyValueWithDefault(ErrorUtils.createErrorType("Recursive dependency")) { @Override protected JetType compute() { //JetFlowInformationProvider flowInformationProvider = computeFlowData(function, bodyExpression); @@ -990,7 +990,7 @@ public class DescriptorResolver { return ErrorUtils.createErrorType("No type, no body"); } else { - LazyValue lazyValue = new LazyValueWithDefault(ErrorUtils.createErrorType("Recursive dependency")) { + RecursionIntolerantLazyValue lazyValue = new RecursionIntolerantLazyValueWithDefault(ErrorUtils.createErrorType("Recursive dependency")) { @Override protected JetType compute() { return expressionTypingServices.safeGetType(scope, initializer, TypeUtils.NO_EXPECTED_TYPE, dataFlowInfo, trace); @@ -1271,7 +1271,7 @@ public class DescriptorResolver { new SimpleFunctionDescriptorImpl(classObjectDescriptor, annotations, VALUES_METHOD_NAME, CallableMemberDescriptor.Kind.DECLARATION); - JetType type = DeferredType.create(trace, new LazyValue() { + JetType type = DeferredType.create(trace, new RecursionIntolerantLazyValue() { @Override protected JetType compute() { return KotlinBuiltIns.getInstance().getArrayType(enumClassDescriptor.getDefaultType()); @@ -1295,7 +1295,7 @@ public class DescriptorResolver { new SimpleFunctionDescriptorImpl(classObjectDescriptor, annotations, VALUE_OF_METHOD_NAME, CallableMemberDescriptor.Kind.DECLARATION); - JetType type = DeferredType.create(trace, new LazyValue() { + JetType type = DeferredType.create(trace, new RecursionIntolerantLazyValue() { @Override protected JetType compute() { return enumClassDescriptor.getDefaultType(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java index 3dd068ffb6c..2f94edbf74b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java @@ -30,7 +30,7 @@ import org.jetbrains.jet.lang.resolve.scopes.JetScope; import org.jetbrains.jet.lang.resolve.scopes.LazyScopeAdapter; import org.jetbrains.jet.lang.types.*; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; -import org.jetbrains.jet.util.lazy.LazyValue; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValue; import javax.inject.Inject; import java.util.ArrayList; @@ -267,7 +267,7 @@ public class TypeResolver { return typeParameterDescriptor.getUpperBoundsAsType().getMemberScope(); } else { - return new LazyScopeAdapter(new LazyValue() { + return new LazyScopeAdapter(new RecursionIntolerantLazyValue() { @Override protected JetScope compute() { return typeParameterDescriptor.getUpperBoundsAsType().getMemberScope(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyClassMemberScope.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyClassMemberScope.java index 1209d5392fa..f6e353d225b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyClassMemberScope.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyClassMemberScope.java @@ -31,7 +31,7 @@ import org.jetbrains.jet.lang.types.DeferredType; import org.jetbrains.jet.lang.types.ErrorUtils; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; -import org.jetbrains.jet.util.lazy.LazyValue; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValue; import java.util.*; @@ -358,7 +358,7 @@ public class LazyClassMemberScope extends AbstractLazyMemberScope() { + descriptor.setReturnType(DeferredType.create(resolveSession.getTrace(), new RecursionIntolerantLazyValue() { @Override protected JetType compute() { return thisDescriptor.getDefaultType(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyTypeParameterDescriptor.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyTypeParameterDescriptor.java index 4bdc89ef9c1..57a6de8e2c2 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyTypeParameterDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/LazyTypeParameterDescriptor.java @@ -33,7 +33,7 @@ import org.jetbrains.jet.lang.types.*; import org.jetbrains.jet.lang.types.checker.JetTypeChecker; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; import org.jetbrains.jet.lexer.JetTokens; -import org.jetbrains.jet.util.lazy.LazyValue; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValue; import java.util.Collection; import java.util.Collections; @@ -215,7 +215,7 @@ public class LazyTypeParameterDescriptor implements TypeParameterDescriptor, Laz @Override public JetType getDefaultType() { if (defaultType == null) { - defaultType = new JetTypeImpl(getTypeConstructor(), new LazyScopeAdapter(new LazyValue() { + defaultType = new JetTypeImpl(getTypeConstructor(), new LazyScopeAdapter(new RecursionIntolerantLazyValue() { @Override protected JetScope compute() { return getUpperBoundsAsType().getMemberScope(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.java index 056cd062747..170fdc6f54c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.java @@ -18,13 +18,13 @@ package org.jetbrains.jet.lang.resolve.scopes; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.resolve.AbstractScopeAdapter; -import org.jetbrains.jet.util.lazy.LazyValue; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValue; public class LazyScopeAdapter extends AbstractScopeAdapter { - private final LazyValue scope; + private final RecursionIntolerantLazyValue scope; - public LazyScopeAdapter(LazyValue scope) { + public LazyScopeAdapter(RecursionIntolerantLazyValue scope) { this.scope = scope; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/DeferredType.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/DeferredType.java index f61cf07a714..9ac1cdf7032 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/DeferredType.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/DeferredType.java @@ -21,7 +21,7 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.scopes.JetScope; import org.jetbrains.jet.util.Box; -import org.jetbrains.jet.util.lazy.LazyValue; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValue; import org.jetbrains.jet.util.lazy.ReenteringLazyValueComputationException; import java.util.List; @@ -30,15 +30,15 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.DEFERRED_TYPE; public class DeferredType implements JetType { - public static DeferredType create(BindingTrace trace, LazyValue lazyValue) { + public static DeferredType create(BindingTrace trace, RecursionIntolerantLazyValue lazyValue) { DeferredType deferredType = new DeferredType(lazyValue); trace.record(DEFERRED_TYPE, new Box(deferredType)); return deferredType; } - private final LazyValue lazyValue; + private final RecursionIntolerantLazyValue lazyValue; - private DeferredType(LazyValue lazyValue) { + private DeferredType(RecursionIntolerantLazyValue lazyValue) { this.lazyValue = lazyValue; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java index 1f5bcf7bce7..b1231c1b5ae 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java @@ -30,7 +30,7 @@ import org.jetbrains.jet.lang.resolve.scopes.JetScope; import org.jetbrains.jet.lang.types.*; import org.jetbrains.jet.lang.types.checker.JetTypeChecker; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; -import org.jetbrains.jet.util.lazy.LazyValueWithDefault; +import org.jetbrains.jet.util.lazy.RecursionIntolerantLazyValueWithDefault; import org.jetbrains.jet.util.slicedmap.WritableSlice; import java.util.Collections; @@ -60,7 +60,7 @@ public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor { @Override public void handleRecord(WritableSlice slice, PsiElement declaration, final ClassDescriptor descriptor) { if (slice == CLASS && declaration == expression.getObjectDeclaration()) { - JetType defaultType = DeferredType.create(context.trace, new LazyValueWithDefault(ErrorUtils.createErrorType("Recursive dependency")) { + JetType defaultType = DeferredType.create(context.trace, new RecursionIntolerantLazyValueWithDefault(ErrorUtils.createErrorType("Recursive dependency")) { @Override protected JetType compute() { return descriptor.getDefaultType(); diff --git a/compiler/frontend/src/org/jetbrains/jet/util/lazy/LazyValue.java b/compiler/frontend/src/org/jetbrains/jet/util/lazy/RecursionIntolerantLazyValue.java similarity index 96% rename from compiler/frontend/src/org/jetbrains/jet/util/lazy/LazyValue.java rename to compiler/frontend/src/org/jetbrains/jet/util/lazy/RecursionIntolerantLazyValue.java index 5d21bc8db23..d171b43ca1e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/util/lazy/LazyValue.java +++ b/compiler/frontend/src/org/jetbrains/jet/util/lazy/RecursionIntolerantLazyValue.java @@ -16,7 +16,7 @@ package org.jetbrains.jet.util.lazy; -public abstract class LazyValue { +public abstract class RecursionIntolerantLazyValue { private enum State { NOT_COMPUTED, diff --git a/compiler/frontend/src/org/jetbrains/jet/util/lazy/LazyValueWithDefault.java b/compiler/frontend/src/org/jetbrains/jet/util/lazy/RecursionIntolerantLazyValueWithDefault.java similarity index 82% rename from compiler/frontend/src/org/jetbrains/jet/util/lazy/LazyValueWithDefault.java rename to compiler/frontend/src/org/jetbrains/jet/util/lazy/RecursionIntolerantLazyValueWithDefault.java index f62f4a622da..f75a863d13d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/util/lazy/LazyValueWithDefault.java +++ b/compiler/frontend/src/org/jetbrains/jet/util/lazy/RecursionIntolerantLazyValueWithDefault.java @@ -16,10 +16,10 @@ package org.jetbrains.jet.util.lazy; -public abstract class LazyValueWithDefault extends LazyValue { +public abstract class RecursionIntolerantLazyValueWithDefault extends RecursionIntolerantLazyValue { private final T defaultValue; - protected LazyValueWithDefault(T defaultValue) { + protected RecursionIntolerantLazyValueWithDefault(T defaultValue) { this.defaultValue = defaultValue; }