Replace object$ -> OBJECT$, instance$ -> INSTANCE$ in the project

This commit is contained in:
Alexander Udalov
2014-07-26 00:21:05 +04:00
parent 549a38ca6f
commit de0f751207
110 changed files with 183 additions and 183 deletions
@@ -1235,7 +1235,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
boolean generateInitializerInOuter = isClassObjectWithBackingFieldsInOuter(descriptor); boolean generateInitializerInOuter = isClassObjectWithBackingFieldsInOuter(descriptor);
if (generateInitializerInOuter) { if (generateInitializerInOuter) {
final ImplementationBodyCodegen parentCodegen = getParentBodyCodegen(this); final ImplementationBodyCodegen parentCodegen = getParentBodyCodegen(this);
//generate object$ //generate OBJECT$
parentCodegen.genInitSingleton(descriptor, StackValue.singleton(descriptor, typeMapper)); parentCodegen.genInitSingleton(descriptor, StackValue.singleton(descriptor, typeMapper));
generateInitializers(new Function0<ExpressionCodegen>() { generateInitializers(new Function0<ExpressionCodegen>() {
@Override @Override
@@ -158,8 +158,8 @@ public class CompileEnvironmentUtil {
method.setAccessible(true); method.setAccessible(true);
method.invoke(null); method.invoke(null);
ArrayList<Module> answer = new ArrayList<Module>(AllModules.instance$.get()); ArrayList<Module> answer = new ArrayList<Module>(AllModules.INSTANCE$.get());
AllModules.instance$.get().clear(); AllModules.INSTANCE$.get().clear();
return answer; return answer;
} }
catch (Exception e) { catch (Exception e) {
@@ -303,7 +303,7 @@ public class CompileEnvironmentUtil {
} }
} }
} }
return Unit.instance$; return Unit.INSTANCE$;
} }
}); });
} }
@@ -209,7 +209,7 @@ public class JetCoreEnvironment {
@Override @Override
public Unit invoke(String s) { public Unit invoke(String s) {
report(ERROR, s); report(ERROR, s);
return Unit.instance$; return Unit.INSTANCE$;
} }
})); }));
JetScriptDefinitionProvider.getInstance(project).addScriptDefinitions( JetScriptDefinitionProvider.getInstance(project).addScriptDefinitions(
@@ -293,7 +293,7 @@ public class KotlinToJVMBytecodeCompiler {
BindingTrace sharedTrace = support.getTrace(); BindingTrace sharedTrace = support.getTrace();
ModuleDescriptorImpl sharedModule = support.getModule(); ModuleDescriptorImpl sharedModule = support.getModule();
IncrementalCacheProvider incrementalCacheProvider = IncrementalCacheProvider.object$.getInstance(); IncrementalCacheProvider incrementalCacheProvider = IncrementalCacheProvider.OBJECT$.getInstance();
File incrementalCacheBaseDir = environment.getConfiguration().get(JVMConfigurationKeys.INCREMENTAL_CACHE_BASE_DIR); File incrementalCacheBaseDir = environment.getConfiguration().get(JVMConfigurationKeys.INCREMENTAL_CACHE_BASE_DIR);
final IncrementalCache incrementalCache; final IncrementalCache incrementalCache;
if (incrementalCacheProvider != null && incrementalCacheBaseDir != null) { if (incrementalCacheProvider != null && incrementalCacheBaseDir != null) {
@@ -345,7 +345,7 @@ public class KotlinToJVMBytecodeCompiler {
) { ) {
CompilerConfiguration configuration = environment.getConfiguration(); CompilerConfiguration configuration = environment.getConfiguration();
File incrementalCacheDir = configuration.get(JVMConfigurationKeys.INCREMENTAL_CACHE_BASE_DIR); File incrementalCacheDir = configuration.get(JVMConfigurationKeys.INCREMENTAL_CACHE_BASE_DIR);
IncrementalCacheProvider incrementalCacheProvider = IncrementalCacheProvider.object$.getInstance(); IncrementalCacheProvider incrementalCacheProvider = IncrementalCacheProvider.OBJECT$.getInstance();
Collection<FqName> packagesWithRemovedFiles; Collection<FqName> packagesWithRemovedFiles;
if (incrementalCacheDir == null || moduleId == null || incrementalCacheProvider == null) { if (incrementalCacheDir == null || moduleId == null || incrementalCacheProvider == null) {
@@ -119,7 +119,7 @@ public enum AnalyzerFacadeForJVM implements AnalyzerFacade {
) { ) {
GlobalContextImpl globalContext = ContextPackage.GlobalContext(); GlobalContextImpl globalContext = ContextPackage.GlobalContext();
DeclarationProviderFactory declarationProviderFactory = DeclarationProviderFactoryService.object$ DeclarationProviderFactory declarationProviderFactory = DeclarationProviderFactoryService.OBJECT$
.createDeclarationProviderFactory(project, globalContext.getStorageManager(), syntheticFiles, filesScope); .createDeclarationProviderFactory(project, globalContext.getStorageManager(), syntheticFiles, filesScope);
InjectorForLazyResolveWithJava resolveWithJava = new InjectorForLazyResolveWithJava( InjectorForLazyResolveWithJava resolveWithJava = new InjectorForLazyResolveWithJava(
@@ -36,7 +36,7 @@ public class JavaPropertyInitializerEvaluatorImpl implements JavaPropertyInitial
if (evaluatedExpression != null) { if (evaluatedExpression != null) {
return ConstantsPackage.createCompileTimeConstant( return ConstantsPackage.createCompileTimeConstant(
evaluatedExpression, evaluatedExpression,
ConstantExpressionEvaluator.object$.isPropertyCompileTimeConstant(descriptor), ConstantExpressionEvaluator.OBJECT$.isPropertyCompileTimeConstant(descriptor),
false, false,
true, true,
descriptor.getType()); descriptor.getType());
@@ -216,7 +216,7 @@ public class JetControlFlowProcessor {
@NotNull @NotNull
private Map<PseudoValue, TypePredicate> defaultTypeMap(List<PseudoValue> values) { private Map<PseudoValue, TypePredicate> defaultTypeMap(List<PseudoValue> values) {
return PseudocodePackage.expectedTypeFor(AllTypes.instance$, values); return PseudocodePackage.expectedTypeFor(AllTypes.INSTANCE$, values);
} }
private void mergeValues(@NotNull List<JetExpression> from, @NotNull JetExpression to) { private void mergeValues(@NotNull List<JetExpression> from, @NotNull JetExpression to) {
@@ -268,7 +268,7 @@ public class JetControlFlowProcessor {
@NotNull @NotNull
private AccessTarget getResolvedCallAccessTarget(JetElement element) { private AccessTarget getResolvedCallAccessTarget(JetElement element) {
ResolvedCall<?> resolvedCall = getResolvedCall(element, trace.getBindingContext()); ResolvedCall<?> resolvedCall = getResolvedCall(element, trace.getBindingContext());
return resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.instance$; return resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.INSTANCE$;
} }
@NotNull @NotNull
@@ -276,7 +276,7 @@ public class JetControlFlowProcessor {
DeclarationDescriptor descriptor = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element); DeclarationDescriptor descriptor = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element);
return descriptor instanceof VariableDescriptor return descriptor instanceof VariableDescriptor
? new AccessTarget.Declaration((VariableDescriptor) descriptor) ? new AccessTarget.Declaration((VariableDescriptor) descriptor)
: AccessTarget.BlackBox.instance$; : AccessTarget.BlackBox.INSTANCE$;
} }
@Override @Override
@@ -457,7 +457,7 @@ public class JetControlFlowProcessor {
} }
Map<PseudoValue, ReceiverValue> receiverValues = SmartFMap.emptyMap(); Map<PseudoValue, ReceiverValue> receiverValues = SmartFMap.emptyMap();
AccessTarget accessTarget = AccessTarget.BlackBox.instance$; AccessTarget accessTarget = AccessTarget.BlackBox.INSTANCE$;
boolean unsupported = false; boolean unsupported = false;
if (left instanceof JetSimpleNameExpression || left instanceof JetQualifiedExpression) { if (left instanceof JetSimpleNameExpression || left instanceof JetQualifiedExpression) {
accessTarget = getResolvedCallAccessTarget(PsiUtilPackage.getQualifiedElementSelector(left)); accessTarget = getResolvedCallAccessTarget(PsiUtilPackage.getQualifiedElementSelector(left));
@@ -892,7 +892,7 @@ public class JetControlFlowProcessor {
JetMultiDeclaration multiDeclaration = expression.getMultiParameter(); JetMultiDeclaration multiDeclaration = expression.getMultiParameter();
JetExpression loopRange = expression.getLoopRange(); JetExpression loopRange = expression.getLoopRange();
TypePredicate loopRangeTypePredicate = AllTypes.instance$; TypePredicate loopRangeTypePredicate = AllTypes.INSTANCE$;
ResolvedCall<?> iteratorResolvedCall = trace.get(BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL, loopRange); ResolvedCall<?> iteratorResolvedCall = trace.get(BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL, loopRange);
if (iteratorResolvedCall != null) { if (iteratorResolvedCall != null) {
ReceiverValue iteratorReceiver = getExplicitReceiverValue(iteratorResolvedCall); ReceiverValue iteratorReceiver = getExplicitReceiverValue(iteratorResolvedCall);
@@ -1400,7 +1400,7 @@ public class JetControlFlowProcessor {
TypePredicate expectedTypePredicate = TypePredicate expectedTypePredicate =
PseudocodePackage.getSubtypesPredicate(trace.get(BindingContext.TYPE, specifier.getTypeReference())); PseudocodePackage.getSubtypesPredicate(trace.get(BindingContext.TYPE, specifier.getTypeReference()));
if (expectedTypePredicate == null) { if (expectedTypePredicate == null) {
expectedTypePredicate = AllTypes.instance$; expectedTypePredicate = AllTypes.INSTANCE$;
} }
builder.magic(specifier, specifier, arguments, PseudocodePackage.expectedTypeFor(expectedTypePredicate, arguments), MagicKind.VALUE_CONSUMER); builder.magic(specifier, specifier, arguments, PseudocodePackage.expectedTypeFor(expectedTypePredicate, arguments), MagicKind.VALUE_CONSUMER);
} }
@@ -957,7 +957,7 @@ public class JetFlowInformationProvider {
@Override @Override
public Unit invoke(Instruction instruction, D enterData, D exitData) { public Unit invoke(Instruction instruction, D enterData, D exitData) {
execute(instruction, enterData, exitData); execute(instruction, enterData, exitData);
return Unit.instance$; return Unit.INSTANCE$;
} }
public abstract void execute(Instruction instruction, D enterData, D exitData); public abstract void execute(Instruction instruction, D enterData, D exitData);
@@ -967,7 +967,7 @@ public class JetFlowInformationProvider {
@Override @Override
public Unit invoke(P p) { public Unit invoke(P p) {
execute(p); execute(p);
return Unit.instance$; return Unit.INSTANCE$;
} }
public abstract void execute(P p); public abstract void execute(P p);
@@ -85,7 +85,7 @@ public class PseudocodeVariablesData {
if (variableDescriptor != null) { if (variableDescriptor != null) {
result.add(variableDescriptor); result.add(variableDescriptor);
} }
return Unit.instance$; return Unit.INSTANCE$;
} }
}); });
usedVariables = Collections.unmodifiableSet(result); usedVariables = Collections.unmodifiableSet(result);
@@ -418,7 +418,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
@Override @Override
public InstructionWithValue loadStringTemplate(@NotNull JetStringTemplateExpression expression, @NotNull List<PseudoValue> inputValues) { public InstructionWithValue loadStringTemplate(@NotNull JetStringTemplateExpression expression, @NotNull List<PseudoValue> inputValues) {
if (inputValues.isEmpty()) return read(expression); if (inputValues.isEmpty()) return read(expression);
Map<PseudoValue, TypePredicate> predicate = PseudocodePackage.expectedTypeFor(AllTypes.instance$, inputValues); Map<PseudoValue, TypePredicate> predicate = PseudocodePackage.expectedTypeFor(AllTypes.INSTANCE$, inputValues);
return magic(expression, expression, inputValues, predicate, MagicKind.STRING_TEMPLATE); return magic(expression, expression, inputValues, predicate, MagicKind.STRING_TEMPLATE);
} }
@@ -431,7 +431,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
@NotNull Map<PseudoValue, TypePredicate> expectedTypes, @NotNull Map<PseudoValue, TypePredicate> expectedTypes,
@NotNull MagicKind kind @NotNull MagicKind kind
) { ) {
MagicInstruction instruction = MagicInstruction.object$.create( MagicInstruction instruction = MagicInstruction.OBJECT$.create(
instructionElement, valueElement, getCurrentScope(), inputValues, expectedTypes, kind, valueFactory instructionElement, valueElement, getCurrentScope(), inputValues, expectedTypes, kind, valueFactory
); );
add(instruction); add(instruction);
@@ -441,7 +441,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
@NotNull @NotNull
@Override @Override
public MergeInstruction merge(@NotNull JetExpression expression, @NotNull List<PseudoValue> inputValues) { public MergeInstruction merge(@NotNull JetExpression expression, @NotNull List<PseudoValue> inputValues) {
MergeInstruction instruction = MergeInstruction.object$.create(expression, getCurrentScope(), inputValues, valueFactory); MergeInstruction instruction = MergeInstruction.OBJECT$.create(expression, getCurrentScope(), inputValues, valueFactory);
add(instruction); add(instruction);
return instruction; return instruction;
} }
@@ -465,7 +465,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
@NotNull Map<PseudoValue, ValueParameterDescriptor> arguments @NotNull Map<PseudoValue, ValueParameterDescriptor> arguments
) { ) {
JetType returnType = resolvedCall.getResultingDescriptor().getReturnType(); JetType returnType = resolvedCall.getResultingDescriptor().getReturnType();
CallInstruction instruction = CallInstruction.object$.create( CallInstruction instruction = CallInstruction.OBJECT$.create(
valueElement, valueElement,
getCurrentScope(), getCurrentScope(),
resolvedCall, resolvedCall,
@@ -492,7 +492,7 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
expectedTypes = PseudocodePackage.expectedTypeFor(onlyBoolean, inputValues); expectedTypes = PseudocodePackage.expectedTypeFor(onlyBoolean, inputValues);
break; break;
case NOT_NULL_ASSERTION: case NOT_NULL_ASSERTION:
expectedTypes = PseudocodePackage.expectedTypeFor(AllTypes.instance$, inputValues); expectedTypes = PseudocodePackage.expectedTypeFor(AllTypes.INSTANCE$, inputValues);
break; break;
default: default:
throw new IllegalArgumentException("Invalid operation: " + operation); throw new IllegalArgumentException("Invalid operation: " + operation);
@@ -526,8 +526,8 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
@Nullable ResolvedCall<?> resolvedCall, @Nullable ResolvedCall<?> resolvedCall,
@NotNull Map<PseudoValue, ReceiverValue> receiverValues @NotNull Map<PseudoValue, ReceiverValue> receiverValues
) { ) {
AccessTarget accessTarget = resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.instance$; AccessTarget accessTarget = resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.INSTANCE$;
ReadValueInstruction instruction = ReadValueInstruction.object$.create( ReadValueInstruction instruction = ReadValueInstruction.OBJECT$.create(
expression, getCurrentScope(), accessTarget, receiverValues, valueFactory expression, getCurrentScope(), accessTarget, receiverValues, valueFactory
); );
add(instruction); add(instruction);
@@ -54,7 +54,7 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
return childExpressionsByStub[0]; return childExpressionsByStub[0];
} }
} }
return JetQualifiedExpressionImpl.instance$.getReceiverExpression(this); return JetQualifiedExpressionImpl.INSTANCE$.getReceiverExpression(this);
} }
@Nullable @Nullable
@@ -67,7 +67,7 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
return childExpressionsByStub[1]; return childExpressionsByStub[1];
} }
} }
return JetQualifiedExpressionImpl.instance$.getSelectorExpression(this); return JetQualifiedExpressionImpl.INSTANCE$.getSelectorExpression(this);
} }
@@ -93,12 +93,12 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub<PsiJetPlace
@NotNull @NotNull
@Override @Override
public ASTNode getOperationTokenNode() { public ASTNode getOperationTokenNode() {
return JetQualifiedExpressionImpl.instance$.getOperationTokenNode(this); return JetQualifiedExpressionImpl.INSTANCE$.getOperationTokenNode(this);
} }
@NotNull @NotNull
@Override @Override
public JetToken getOperationSign() { public JetToken getOperationSign() {
return JetQualifiedExpressionImpl.instance$.getOperationSign(this); return JetQualifiedExpressionImpl.INSTANCE$.getOperationSign(this);
} }
} }
@@ -48,13 +48,13 @@ public class JetNameReferenceExpression extends JetExpressionImplStub<PsiJetName
if (stub != null) { if (stub != null) {
return stub.getReferencedName(); return stub.getReferencedName();
} }
return JetSimpleNameExpressionImpl.object$.getReferencedNameImpl(this); return JetSimpleNameExpressionImpl.OBJECT$.getReferencedNameImpl(this);
} }
@Override @Override
@NotNull @NotNull
public Name getReferencedNameAsName() { public Name getReferencedNameAsName() {
return JetSimpleNameExpressionImpl.object$.getReferencedNameAsNameImpl(this); return JetSimpleNameExpressionImpl.OBJECT$.getReferencedNameAsNameImpl(this);
} }
@Override @Override
@@ -76,7 +76,7 @@ public class JetNameReferenceExpression extends JetExpressionImplStub<PsiJetName
@NotNull @NotNull
@Override @Override
public IElementType getReferencedNameElementType() { public IElementType getReferencedNameElementType() {
return JetSimpleNameExpressionImpl.object$.getReferencedNameElementTypeImpl(this); return JetSimpleNameExpressionImpl.OBJECT$.getReferencedNameElementTypeImpl(this);
} }
@Override @Override
@@ -34,24 +34,24 @@ public class JetSafeQualifiedExpression extends JetExpressionImpl implements Jet
@NotNull @NotNull
@Override @Override
public JetExpression getReceiverExpression() { public JetExpression getReceiverExpression() {
return JetQualifiedExpressionImpl.instance$.getReceiverExpression(this); return JetQualifiedExpressionImpl.INSTANCE$.getReceiverExpression(this);
} }
@Nullable @Nullable
@Override @Override
public JetExpression getSelectorExpression() { public JetExpression getSelectorExpression() {
return JetQualifiedExpressionImpl.instance$.getSelectorExpression(this); return JetQualifiedExpressionImpl.INSTANCE$.getSelectorExpression(this);
} }
@NotNull @NotNull
@Override @Override
public ASTNode getOperationTokenNode() { public ASTNode getOperationTokenNode() {
return JetQualifiedExpressionImpl.instance$.getOperationTokenNode(this); return JetQualifiedExpressionImpl.INSTANCE$.getOperationTokenNode(this);
} }
@NotNull @NotNull
@Override @Override
public JetToken getOperationSign() { public JetToken getOperationSign() {
return JetQualifiedExpressionImpl.instance$.getOperationSign(this); return JetQualifiedExpressionImpl.INSTANCE$.getOperationSign(this);
} }
} }
@@ -60,7 +60,7 @@ public class JetClassElementType extends JetStubElementType<PsiJetClassStub, Jet
List<String> superNames = PsiUtilPackage.getSuperNames(psi); List<String> superNames = PsiUtilPackage.getSuperNames(psi);
return new PsiJetClassStubImpl( return new PsiJetClassStubImpl(
getStubType(isEnumEntry), parentStub, StringRef.fromString(fqName != null ? fqName.asString() : null), getStubType(isEnumEntry), parentStub, StringRef.fromString(fqName != null ? fqName.asString() : null),
StringRef.fromString(psi.getName()), Utils.instance$.wrapStrings(superNames), psi.isTrait(), isEnumEntry, StringRef.fromString(psi.getName()), Utils.INSTANCE$.wrapStrings(superNames), psi.isTrait(), isEnumEntry,
psi.isLocal(), psi.isTopLevel()); psi.isLocal(), psi.isTopLevel());
} }
@@ -47,7 +47,7 @@ public class JetObjectElementType extends JetStubElementType<PsiJetObjectStub, J
String name = psi.getName(); String name = psi.getName();
FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi); FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
List<String> superNames = PsiUtilPackage.getSuperNames(psi); List<String> superNames = PsiUtilPackage.getSuperNames(psi);
return new PsiJetObjectStubImpl(parentStub, StringRef.fromString(name), fqName, Utils.instance$.wrapStrings(superNames), return new PsiJetObjectStubImpl(parentStub, StringRef.fromString(name), fqName, Utils.INSTANCE$.wrapStrings(superNames),
psi.isTopLevel(), isClassObject(psi), psi.isLocal(), psi.isObjectLiteral()); psi.isTopLevel(), isClassObject(psi), psi.isLocal(), psi.isObjectLiteral());
} }
@@ -361,7 +361,7 @@ public class AnnotationResolver {
for (ValueArgument argument : resolvedValueArgument.getArguments()) { for (ValueArgument argument : resolvedValueArgument.getArguments()) {
JetExpression argumentExpression = argument.getArgumentExpression(); JetExpression argumentExpression = argument.getArgumentExpression();
if (argumentExpression != null) { if (argumentExpression != null) {
CompileTimeConstant<?> constant = ConstantExpressionEvaluator.object$.evaluate(argumentExpression, trace, expectedType); CompileTimeConstant<?> constant = ConstantExpressionEvaluator.OBJECT$.evaluate(argumentExpression, trace, expectedType);
if (constant instanceof IntegerValueTypeConstant) { if (constant instanceof IntegerValueTypeConstant) {
JetType defaultType = ((IntegerValueTypeConstant) constant).getType(expectedType); JetType defaultType = ((IntegerValueTypeConstant) constant).getType(expectedType);
ArgumentTypeResolver.updateNumberType(defaultType, argumentExpression, trace); ArgumentTypeResolver.updateNumberType(defaultType, argumentExpression, trace);
@@ -129,7 +129,7 @@ public class CompileTimeConstantUtils {
) { ) {
if (expression == null) return false; if (expression == null) return false;
CompileTimeConstant<?> compileTimeConstant = CompileTimeConstant<?> compileTimeConstant =
ConstantExpressionEvaluator.object$.evaluate(expression, trace, KotlinBuiltIns.getInstance().getBooleanType()); ConstantExpressionEvaluator.OBJECT$.evaluate(expression, trace, KotlinBuiltIns.getInstance().getBooleanType());
if (!(compileTimeConstant instanceof BooleanValue) || compileTimeConstant.usesVariableAsConstant()) return false; if (!(compileTimeConstant instanceof BooleanValue) || compileTimeConstant.usesVariableAsConstant()) return false;
Boolean value = ((BooleanValue) compileTimeConstant).getValue(); Boolean value = ((BooleanValue) compileTimeConstant).getValue();
@@ -1078,7 +1078,7 @@ public class DescriptorResolver {
public CompileTimeConstant<?> invoke() { public CompileTimeConstant<?> invoke() {
JetExpression initializer = variable.getInitializer(); JetExpression initializer = variable.getInitializer();
JetType initializerType = expressionTypingServices.safeGetType(scope, initializer, variableType, dataFlowInfo, trace); JetType initializerType = expressionTypingServices.safeGetType(scope, initializer, variableType, dataFlowInfo, trace);
CompileTimeConstant<?> constant = ConstantExpressionEvaluator.object$.evaluate(initializer, trace, initializerType); CompileTimeConstant<?> constant = ConstantExpressionEvaluator.OBJECT$.evaluate(initializer, trace, initializerType);
if (constant instanceof IntegerValueTypeConstant) { if (constant instanceof IntegerValueTypeConstant) {
return EvaluatePackage.createCompileTimeConstantWithType((IntegerValueTypeConstant) constant, initializerType); return EvaluatePackage.createCompileTimeConstantWithType((IntegerValueTypeConstant) constant, initializerType);
} }
@@ -192,7 +192,7 @@ public class OverrideResolver {
if (element instanceof JetDeclaration) { if (element instanceof JetDeclaration) {
trace.report(CANNOT_INFER_VISIBILITY.on((JetDeclaration) element, descriptor)); trace.report(CANNOT_INFER_VISIBILITY.on((JetDeclaration) element, descriptor));
} }
return Unit.instance$; return Unit.INSTANCE$;
} }
}; };
} }
@@ -247,7 +247,7 @@ public class OverrideResolver {
public boolean isEqual(D d1, D d2) { public boolean isEqual(D d1, D d2) {
CallableDescriptor f = transform.fun(d1); CallableDescriptor f = transform.fun(d1);
CallableDescriptor g = transform.fun(d2); CallableDescriptor g = transform.fun(d2);
return DescriptorEquivalenceForOverrides.instance$.areEquivalent(f.getOriginal(), g.getOriginal()); return DescriptorEquivalenceForOverrides.INSTANCE$.areEquivalent(f.getOriginal(), g.getOriginal());
} }
}); });
@@ -294,10 +294,10 @@ public class OverrideResolver {
// when B is defined in modules m1 and m2, and C (indirectly) inherits from both versions, // when B is defined in modules m1 and m2, and C (indirectly) inherits from both versions,
// we'll be getting sets of members that do not override each other, but are structurally equivalent. // we'll be getting sets of members that do not override each other, but are structurally equivalent.
// As other code relies on no equal descriptors passed here, we guard against f == g, but this may not be necessary // As other code relies on no equal descriptors passed here, we guard against f == g, but this may not be necessary
if (!f.equals(g) && DescriptorEquivalenceForOverrides.instance$.areEquivalent(f.getOriginal(), g.getOriginal())) return true; if (!f.equals(g) && DescriptorEquivalenceForOverrides.INSTANCE$.areEquivalent(f.getOriginal(), g.getOriginal())) return true;
CallableDescriptor originalG = g.getOriginal(); CallableDescriptor originalG = g.getOriginal();
for (D overriddenFunction : getAllOverriddenDescriptors(f)) { for (D overriddenFunction : getAllOverriddenDescriptors(f)) {
if (DescriptorEquivalenceForOverrides.instance$.areEquivalent(originalG, overriddenFunction.getOriginal())) return true; if (DescriptorEquivalenceForOverrides.INSTANCE$.areEquivalent(originalG, overriddenFunction.getOriginal())) return true;
} }
return false; return false;
} }
@@ -290,6 +290,6 @@ public class ArgumentTypeResolver {
return; return;
} }
ConstantExpressionEvaluator.object$.evaluate(expression, trace, numberType); ConstantExpressionEvaluator.OBJECT$.evaluate(expression, trace, numberType);
} }
} }
@@ -467,7 +467,7 @@ public class CallExpressionResolver {
context.trace.record(BindingContext.EXPRESSION_TYPE, selectorExpression, selectorReturnType); context.trace.record(BindingContext.EXPRESSION_TYPE, selectorExpression, selectorReturnType);
} }
CompileTimeConstant<?> value = ConstantExpressionEvaluator.object$.evaluate(expression, context.trace, context.expectedType); CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, context.trace, context.expectedType);
if (value instanceof IntegerValueConstant && ((IntegerValueConstant) value).isPure()) { if (value instanceof IntegerValueConstant && ((IntegerValueConstant) value).isPure()) {
return BasicExpressionTypingVisitor.createCompileTimeConstantTypeInfo(value, expression, context); return BasicExpressionTypingVisitor.createCompileTimeConstantTypeInfo(value, expression, context);
} }
@@ -272,7 +272,7 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
public ArgumentMapping getArgumentMapping(@NotNull ValueArgument valueArgument) { public ArgumentMapping getArgumentMapping(@NotNull ValueArgument valueArgument) {
ArgumentMatch argumentMatch = argumentToParameterMap.get(valueArgument); ArgumentMatch argumentMatch = argumentToParameterMap.get(valueArgument);
if (argumentMatch == null) { if (argumentMatch == null) {
return ArgumentUnmapped.instance$; return ArgumentUnmapped.INSTANCE$;
} }
return argumentMatch; return argumentMatch;
} }
@@ -515,7 +515,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
@Override @Override
public Unit invoke(@NotNull Supertypes supertypes) { public Unit invoke(@NotNull Supertypes supertypes) {
findAndDisconnectLoopsInTypeHierarchy(supertypes); findAndDisconnectLoopsInTypeHierarchy(supertypes);
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -118,7 +118,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
@Override @Override
public JetTypeInfo visitConstantExpression(@NotNull JetConstantExpression expression, ExpressionTypingContext context) { public JetTypeInfo visitConstantExpression(@NotNull JetConstantExpression expression, ExpressionTypingContext context) {
CompileTimeConstant<?> value = ConstantExpressionEvaluator.object$.evaluate(expression, context.trace, context.expectedType); CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, context.trace, context.expectedType);
if (!(value instanceof IntegerValueTypeConstant)) { if (!(value instanceof IntegerValueTypeConstant)) {
CompileTimeConstantChecker compileTimeConstantChecker = context.getCompileTimeConstantChecker(); CompileTimeConstantChecker compileTimeConstantChecker = context.getCompileTimeConstantChecker();
@@ -752,7 +752,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
result = returnType; result = returnType;
} }
CompileTimeConstant<?> value = ConstantExpressionEvaluator.object$.evaluate(expression, contextWithExpectedType.trace, CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, contextWithExpectedType.trace,
contextWithExpectedType.expectedType); contextWithExpectedType.expectedType);
if (value != null) { if (value != null) {
return createCompileTimeConstantTypeInfo(value, expression, contextWithExpectedType); return createCompileTimeConstantTypeInfo(value, expression, contextWithExpectedType);
@@ -917,7 +917,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
context.trace.report(UNSUPPORTED.on(operationSign, "Unknown operation")); context.trace.report(UNSUPPORTED.on(operationSign, "Unknown operation"));
result = JetTypeInfo.create(null, context.dataFlowInfo); result = JetTypeInfo.create(null, context.dataFlowInfo);
} }
CompileTimeConstant<?> value = ConstantExpressionEvaluator.object$. CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.
evaluate(expression, contextWithExpectedType.trace, contextWithExpectedType.expectedType); evaluate(expression, contextWithExpectedType.trace, contextWithExpectedType.expectedType);
if (value != null) { if (value != null) {
return createCompileTimeConstantTypeInfo(value, expression, contextWithExpectedType); return createCompileTimeConstantTypeInfo(value, expression, contextWithExpectedType);
@@ -1257,7 +1257,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
} }
}); });
} }
ConstantExpressionEvaluator.object$.evaluate(expression, context.trace, contextWithExpectedType.expectedType); ConstantExpressionEvaluator.OBJECT$.evaluate(expression, context.trace, contextWithExpectedType.expectedType);
return DataFlowUtils.checkType(KotlinBuiltIns.getInstance().getStringType(), expression, contextWithExpectedType, dataFlowInfo[0]); return DataFlowUtils.checkType(KotlinBuiltIns.getInstance().getStringType(), expression, contextWithExpectedType, dataFlowInfo[0]);
} }
@@ -170,7 +170,7 @@ public class DataFlowUtils {
} }
if (expression instanceof JetConstantExpression) { if (expression instanceof JetConstantExpression) {
CompileTimeConstant<?> value = ConstantExpressionEvaluator.object$.evaluate(expression, trace, expectedType); CompileTimeConstant<?> value = ConstantExpressionEvaluator.OBJECT$.evaluate(expression, trace, expectedType);
if (value instanceof IntegerValueTypeConstant) { if (value instanceof IntegerValueTypeConstant) {
value = EvaluatePackage.createCompileTimeConstantWithType((IntegerValueTypeConstant) value, expectedType); value = EvaluatePackage.createCompileTimeConstantWithType((IntegerValueTypeConstant) value, expectedType);
} }
@@ -396,7 +396,7 @@ public class ExpressionTypingServices {
if (defaultValue != null) { if (defaultValue != null) {
getType(declaringScope, defaultValue, valueParameterDescriptor.getType(), dataFlowInfo, trace); getType(declaringScope, defaultValue, valueParameterDescriptor.getType(), dataFlowInfo, trace);
if (DescriptorUtils.isAnnotationClass(DescriptorResolver.getContainingClass(declaringScope))) { if (DescriptorUtils.isAnnotationClass(DescriptorResolver.getContainingClass(declaringScope))) {
ConstantExpressionEvaluator.object$.evaluate(defaultValue, trace, valueParameterDescriptor.getType()); ConstantExpressionEvaluator.OBJECT$.evaluate(defaultValue, trace, valueParameterDescriptor.getType());
} }
} }
} }
@@ -2,7 +2,7 @@ public final class ClassObjectField implements kotlin.jvm.internal.KObject {
@org.jetbrains.annotations.Nullable @org.jetbrains.annotations.Nullable
public static final java.lang.String x = ""; public static final java.lang.String x = "";
private static final java.lang.String y = ""; private static final java.lang.String y = "";
public static final ClassObjectField.object object$; public static final ClassObjectField.object OBJECT$;
public ClassObjectField() { /* compiled code */ } public ClassObjectField() { /* compiled code */ }
@@ -1,5 +1,5 @@
public interface TraitClassObjectField extends kotlin.jvm.internal.KObject { public interface TraitClassObjectField extends kotlin.jvm.internal.KObject {
TraitClassObjectField.object object$; TraitClassObjectField.object OBJECT$;
@org.jetbrains.annotations.Nullable @org.jetbrains.annotations.Nullable
java.lang.String x = ""; java.lang.String x = "";
@@ -2,18 +2,18 @@ package test;
class ClassObject { class ClassObject {
void accessToClassObject() { void accessToClassObject() {
WithClassObject.object$.foo(); WithClassObject.OBJECT$.foo();
WithClassObject.object$.getValue(); WithClassObject.OBJECT$.getValue();
WithClassObject.object$.getValueWithGetter(); WithClassObject.OBJECT$.getValueWithGetter();
WithClassObject.object$.getVariable(); WithClassObject.OBJECT$.getVariable();
WithClassObject.object$.setVariable(0); WithClassObject.OBJECT$.setVariable(0);
WithClassObject.object$.getVariableWithAccessors(); WithClassObject.OBJECT$.getVariableWithAccessors();
WithClassObject.object$.setVariableWithAccessors(0); WithClassObject.OBJECT$.setVariableWithAccessors(0);
} }
void accessToPackageObject() { void accessToPackageObject() {
PackageInner.instance$.foo(); PackageInner.INSTANCE$.foo();
PackageInner.instance$.getValue(); PackageInner.INSTANCE$.getValue();
} }
void accessToInnerClass() { void accessToInnerClass() {
@@ -1,5 +1,5 @@
class C { class C {
<!CONFLICTING_JVM_DECLARATIONS!>class object<!> {} <!CONFLICTING_JVM_DECLARATIONS!>class object<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>val `object$`<!> = C <!CONFLICTING_JVM_DECLARATIONS!>val `OBJECT$`<!> = C
} }
@@ -1,7 +1,7 @@
class C { class C {
<!CONFLICTING_JVM_DECLARATIONS!>class object<!> { <!CONFLICTING_JVM_DECLARATIONS!>class object<!> {
<!CONFLICTING_JVM_DECLARATIONS!>val `object$`<!> = this <!CONFLICTING_JVM_DECLARATIONS!>val `OBJECT$`<!> = this
} }
val `object$` = C val `OBJECT$` = C
} }
@@ -1,3 +1,3 @@
object <!CONFLICTING_JVM_DECLARATIONS!>O<!> { object <!CONFLICTING_JVM_DECLARATIONS!>O<!> {
<!CONFLICTING_JVM_DECLARATIONS!>val `instance$`: O<!> = null!! <!CONFLICTING_JVM_DECLARATIONS!>val `INSTANCE$`: O<!> = null!!
} }
@@ -281,7 +281,7 @@ public class StorageManagerTest extends TestCase {
new Function1<String, Unit>() { new Function1<String, Unit>() {
@Override @Override
public Unit invoke(String s) { public Unit invoke(String s) {
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -317,7 +317,7 @@ public class StorageManagerTest extends TestCase {
public Unit invoke(String s) { public Unit invoke(String s) {
counter.inc(); counter.inc();
assertEquals("tolerant", s); assertEquals("tolerant", s);
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -346,7 +346,7 @@ public class StorageManagerTest extends TestCase {
public Unit invoke(Collection<String> strings) { public Unit invoke(Collection<String> strings) {
counter.inc(); counter.inc();
strings.add("postComputed"); strings.add("postComputed");
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -372,7 +372,7 @@ public class StorageManagerTest extends TestCase {
public Unit invoke(Collection<String> strings) { public Unit invoke(Collection<String> strings) {
counter.inc(); counter.inc();
strings.add("postComputed"); strings.add("postComputed");
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -405,7 +405,7 @@ public class StorageManagerTest extends TestCase {
@Override @Override
public Unit invoke(String s) { public Unit invoke(String s) {
fail("Recursion-tolerating value should not be post computed"); fail("Recursion-tolerating value should not be post computed");
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -60,7 +60,7 @@ public final class DescriptorResolverUtils {
@Override @Override
public Unit invoke(@NotNull CallableMemberDescriptor descriptor) { public Unit invoke(@NotNull CallableMemberDescriptor descriptor) {
errorReporter.reportCannotInferVisibility(descriptor); errorReporter.reportCannotInferVisibility(descriptor);
return Unit.instance$; return Unit.INSTANCE$;
} }
}); });
result.add((D) fakeOverride); result.add((D) fakeOverride);
@@ -96,7 +96,7 @@ public class JetPluginUtil {
} }
public static boolean isGradleModule(@NotNull Module module) { public static boolean isGradleModule(@NotNull Module module) {
return ModuleTypeCacheManager.object$.geInstance(module.getProject()).isGradleModule(module); return ModuleTypeCacheManager.OBJECT$.geInstance(module.getProject()).isGradleModule(module);
} }
public static boolean isMavenModule(@NotNull Module module) { public static boolean isMavenModule(@NotNull Module module) {
@@ -53,10 +53,10 @@ public class JavaToKotlinAction extends AnAction {
return; return;
} }
final Converter converter = Converter.object$.create(project, final Converter converter = Converter.OBJECT$.create(project,
ConverterSettings.defaultSettings, ConverterSettings.defaultSettings,
new FilesConversionScope(selectedJavaFiles), new FilesConversionScope(selectedJavaFiles),
J2kPostProcessor.instance$); J2kPostProcessor.INSTANCE$);
CommandProcessor.getInstance().executeCommand( CommandProcessor.getInstance().executeCommand(
project, project,
new Runnable() { new Runnable() {
@@ -107,7 +107,7 @@ public class JetAddFunctionToClassifierAction implements QuestionAction {
PsiElement anchor = body.getRBrace(); PsiElement anchor = body.getRBrace();
JetNamedFunction insertedFunctionElement = (JetNamedFunction) body.addBefore(functionElement, anchor); JetNamedFunction insertedFunctionElement = (JetNamedFunction) body.addBefore(functionElement, anchor);
ShortenReferences.instance$.process(insertedFunctionElement); ShortenReferences.INSTANCE$.process(insertedFunctionElement);
} }
}); });
} }
@@ -152,7 +152,7 @@ public class JetChangeFunctionSignatureAction implements QuestionAction {
newElement = psiFactory.createFunction(signatureString); newElement = psiFactory.createFunction(signatureString);
} }
newElement = (JetNamedFunction) element.replace(newElement); newElement = (JetNamedFunction) element.replace(newElement);
ShortenReferences.instance$.process(newElement); ShortenReferences.INSTANCE$.process(newElement);
} }
}); });
} }
@@ -101,7 +101,7 @@ public abstract class OverrideImplementMethodsHandler implements LanguageCodeIns
elementsToCompact.add((JetElement) added); elementsToCompact.add((JetElement) added);
} }
ShortenReferences.instance$.process(elementsToCompact); ShortenReferences.INSTANCE$.process(elementsToCompact);
} }
@Nullable @Nullable
@@ -86,7 +86,7 @@ public class MoveDeclarationsOutHelper {
dummyFirstStatement.delete(); dummyFirstStatement.delete();
} }
ShortenReferences.instance$.process(propertiesDeclarations); ShortenReferences.INSTANCE$.process(propertiesDeclarations);
return PsiUtilCore.toPsiElementArray(resultStatements); return PsiUtilCore.toPsiElementArray(resultStatements);
} }
@@ -53,7 +53,7 @@ public class JetClassInsertHandler implements InsertHandler<LookupElement> {
psiDocumentManager.commitAllDocuments(); psiDocumentManager.commitAllDocuments();
RangeMarker rangeMarker = document.createRangeMarker(classNameEnd, classNameEnd + tempSuffix.length()); RangeMarker rangeMarker = document.createRangeMarker(classNameEnd, classNameEnd + tempSuffix.length());
ShortenReferences.instance$.process((JetFile) context.getFile(), startOffset, classNameEnd); ShortenReferences.INSTANCE$.process((JetFile) context.getFile(), startOffset, classNameEnd);
psiDocumentManager.commitAllDocuments(); psiDocumentManager.commitAllDocuments();
psiDocumentManager.doPostponedOperationsAndUnblockDocument(document); psiDocumentManager.doPostponedOperationsAndUnblockDocument(document);
@@ -94,7 +94,7 @@ public class ConfigureKotlinInProjectUtils {
} }
private static void showConfigureKotlinNotification(@NotNull Project project) { private static void showConfigureKotlinNotification(@NotNull Project project) {
ConfigureKotlinNotificationManager.instance$.notify(project); ConfigureKotlinNotificationManager.INSTANCE$.notify(project);
} }
@NotNull @NotNull
@@ -110,7 +110,7 @@ public class AbsentJdkAnnotationsComponent extends AbstractProjectComponent {
public void run() { public void run() {
Collection<Sdk> sdks = collectSdksWithoutAnnotations(); Collection<Sdk> sdks = collectSdksWithoutAnnotations();
if (!sdks.isEmpty()) { if (!sdks.isEmpty()) {
AbsentSdkAnnotationsNotificationManager.instance$.notify(myProject, sdks); AbsentSdkAnnotationsNotificationManager.INSTANCE$.notify(myProject, sdks);
} }
} }
}); });
@@ -154,7 +154,7 @@ public abstract class KotlinFindMemberUsagesHandler<T extends JetNamedDeclaratio
UsagesSearchRequest request = UsagesSearchRequest request =
getSearchHelper(kotlinOptions).newRequest(FindUsagesPackage.toSearchTarget(options, (T) element, true)); getSearchHelper(kotlinOptions).newRequest(FindUsagesPackage.toSearchTarget(options, (T) element, true));
for (PsiReference ref : UsagesSearch.instance$.search(request)) { for (PsiReference ref : UsagesSearch.INSTANCE$.search(request)) {
processUsage(processor, ref); processUsage(processor, ref);
} }
@@ -47,7 +47,7 @@ public class ReconstructTypeInCastOrIsAction extends PsiElementBaseIntentionActi
JetType type = getReconstructedType(typeRef); JetType type = getReconstructedType(typeRef);
JetTypeReference newType = JetPsiFactory(typeRef).createType(DescriptorRenderer.SOURCE_CODE.renderType(type)); JetTypeReference newType = JetPsiFactory(typeRef).createType(DescriptorRenderer.SOURCE_CODE.renderType(type));
JetTypeReference replaced = (JetTypeReference) typeRef.replace(newType); JetTypeReference replaced = (JetTypeReference) typeRef.replace(newType);
ShortenReferences.instance$.process(replaced); ShortenReferences.INSTANCE$.process(replaced);
} }
@Override @Override
@@ -260,7 +260,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
manager.startTemplate(editor, builder.buildInlineTemplate(), new TemplateEditingAdapter() { manager.startTemplate(editor, builder.buildInlineTemplate(), new TemplateEditingAdapter() {
@Override @Override
public void templateFinished(Template template, boolean brokenOff) { public void templateFinished(Template template, boolean brokenOff) {
ShortenReferences.instance$.process(getTypeRef(namedDeclaration)); ShortenReferences.INSTANCE$.process(getTypeRef(namedDeclaration));
} }
}); });
} }
@@ -125,7 +125,7 @@ public class DeclarationUtils {
); );
if (inferredType != null) { if (inferredType != null) {
ShortenReferences.instance$.process(property.getTypeRef()); ShortenReferences.INSTANCE$.process(property.getTypeRef());
} }
return newInitializer; return newInitializer;
@@ -169,7 +169,7 @@ public class KotlinSignatureAnnotationIntention extends BaseIntentionAction impl
@NotNull @NotNull
private static String getDefaultSignature(@NotNull Project project, @NotNull PsiMember psiMember) { private static String getDefaultSignature(@NotNull Project project, @NotNull PsiMember psiMember) {
BindingContext bindingContext = ResolvePackage.getLazyResolveSession(project, TargetPlatform.JVM).getBindingContext(); BindingContext bindingContext = ResolvePackage.getLazyResolveSession(project, TargetPlatform.JVM).getBindingContext();
JavaDescriptorResolver javaDescriptorResolver = JavaResolveExtension.instance$.get(project); JavaDescriptorResolver javaDescriptorResolver = JavaResolveExtension.INSTANCE$.get(project);
PsiClass containingClass = psiMember.getContainingClass(); PsiClass containingClass = psiMember.getContainingClass();
assert containingClass != null; assert containingClass != null;
@@ -95,7 +95,7 @@ public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
BindingContext bindingContext = ResolvePackage.getLazyResolveSession(project, TargetPlatform.JVM).getBindingContext(); BindingContext bindingContext = ResolvePackage.getLazyResolveSession(project, TargetPlatform.JVM).getBindingContext();
JavaDescriptorResolver javaDescriptorResolver = JavaResolveExtension.instance$.get(project); JavaDescriptorResolver javaDescriptorResolver = JavaResolveExtension.INSTANCE$.get(project);
for (PsiElement element : elements) { for (PsiElement element : elements) {
if (!(element instanceof PsiMember)) { if (!(element instanceof PsiMember)) {
@@ -248,15 +248,15 @@ public class QuickFixes {
factories.put(MANY_CLASSES_IN_SUPERTYPE_LIST, RemoveSupertypeFix.createFactory()); factories.put(MANY_CLASSES_IN_SUPERTYPE_LIST, RemoveSupertypeFix.createFactory());
factories.put(NO_GET_METHOD, CreateFunctionFromUsageFix.object$.createCreateGetFunctionFromUsageFactory()); factories.put(NO_GET_METHOD, CreateFunctionFromUsageFix.OBJECT$.createCreateGetFunctionFromUsageFactory());
factories.put(NO_SET_METHOD, CreateFunctionFromUsageFix.object$.createCreateSetFunctionFromUsageFactory()); factories.put(NO_SET_METHOD, CreateFunctionFromUsageFix.OBJECT$.createCreateSetFunctionFromUsageFactory());
JetSingleIntentionActionFactory createHasNextFromUsageFactory = CreateFunctionFromUsageFix.object$.createCreateHasNextFunctionFromUsageFactory(); JetSingleIntentionActionFactory createHasNextFromUsageFactory = CreateFunctionFromUsageFix.OBJECT$.createCreateHasNextFunctionFromUsageFactory();
factories.put(HAS_NEXT_MISSING, createHasNextFromUsageFactory); factories.put(HAS_NEXT_MISSING, createHasNextFromUsageFactory);
factories.put(HAS_NEXT_FUNCTION_NONE_APPLICABLE, createHasNextFromUsageFactory); factories.put(HAS_NEXT_FUNCTION_NONE_APPLICABLE, createHasNextFromUsageFactory);
JetSingleIntentionActionFactory createNextFromUsageFactory = CreateFunctionFromUsageFix.object$.createCreateNextFunctionFromUsageFactory(); JetSingleIntentionActionFactory createNextFromUsageFactory = CreateFunctionFromUsageFix.OBJECT$.createCreateNextFunctionFromUsageFactory();
factories.put(NEXT_MISSING, createNextFromUsageFactory); factories.put(NEXT_MISSING, createNextFromUsageFactory);
factories.put(NEXT_NONE_APPLICABLE, createNextFromUsageFactory); factories.put(NEXT_NONE_APPLICABLE, createNextFromUsageFactory);
factories.put(ITERATOR_MISSING, CreateFunctionFromUsageFix.object$.createCreateIteratorFunctionFromUsageFactory()); factories.put(ITERATOR_MISSING, CreateFunctionFromUsageFix.OBJECT$.createCreateIteratorFunctionFromUsageFactory());
factories.put(COMPONENT_FUNCTION_MISSING, CreateFunctionFromUsageFix.object$.createCreateComponentFunctionFromUsageFactory()); factories.put(COMPONENT_FUNCTION_MISSING, CreateFunctionFromUsageFix.OBJECT$.createCreateComponentFunctionFromUsageFactory());
} }
} }
@@ -295,7 +295,7 @@ public class KotlinInlineValHandler extends InlineActionHandler {
functionLiteral.addAfter(whitespaceToAdd, openBraceElement); functionLiteral.addAfter(whitespaceToAdd, openBraceElement);
} }
} }
ShortenReferences.instance$.process(functionLiteralExpression.getValueParameters()); ShortenReferences.INSTANCE$.process(functionLiteralExpression.getValueParameters());
} }
} }
@@ -337,7 +337,7 @@ public class KotlinInlineValHandler extends InlineActionHandler {
JetPsiFactory psiFactory = JetPsiFactory(containingFile); JetPsiFactory psiFactory = JetPsiFactory(containingFile);
for (JetCallExpression call : callsToAddArguments) { for (JetCallExpression call : callsToAddArguments) {
call.addAfter(psiFactory.createTypeArguments("<" + typeArguments + ">"), call.getCalleeExpression()); call.addAfter(psiFactory.createTypeArguments("<" + typeArguments + ">"), call.getCalleeExpression());
ShortenReferences.instance$.process(call.getTypeArgumentList()); ShortenReferences.INSTANCE$.process(call.getTypeArgumentList());
} }
} }
@@ -413,7 +413,7 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase {
} }
propertyRef.set(property); propertyRef.set(property);
if (noTypeInference) { if (noTypeInference) {
ShortenReferences.instance$.process(property); ShortenReferences.INSTANCE$.process(property);
} }
} }
}; };
@@ -1,7 +1,7 @@
class C { class C {
<error>class object</error> { <error>class object</error> {
<error>val `object$`</error> = this <error>val `OBJECT$`</error> = this
} }
val `object$` = C val `OBJECT$` = C
} }
@@ -1,6 +1,6 @@
public class Testing { public class Testing {
public static void test() { public static void test() {
mockLib.foo.LibClass.object$.<caret> mockLib.foo.LibClass.OBJECT$.<caret>
} }
} }
@@ -4,4 +4,4 @@ public class Testing {
} }
} }
// EXIST: instance$ // EXIST: INSTANCE$
@@ -4,4 +4,4 @@ public class Testing {
} }
} }
// EXIST: instance$ // EXIST: INSTANCE$
@@ -4,6 +4,6 @@ import server.O
class Client { class Client {
fun fooBar() { fun fooBar() {
println("foo = " + O.instance$.getFoo()) println("foo = " + O.INSTANCE$.getFoo())
} }
} }
@@ -1,2 +1,2 @@
Class static member access (7: 28) println("foo = " + O.instance$.getFoo()) Class static member access (7: 28) println("foo = " + O.INSTANCE$.getFoo())
Usage in import (3: 15) import server.O Usage in import (3: 15) import server.O
@@ -4,9 +4,9 @@ import server.*
class Client { class Client {
fun fooBar() { fun fooBar() {
A.object$.setFoo("a"); A.OBJECT$.setFoo("a");
A.foo = "a"; A.foo = "a";
println("a.foo = " + A.object$.getFoo()); println("a.foo = " + A.OBJECT$.getFoo());
println("a.foo = " + A.foo); println("a.foo = " + A.foo);
} }
} }
@@ -1,4 +1,4 @@
Unclassified usage (10: 32) println("a.foo = " + A.foo); Unclassified usage (10: 32) println("a.foo = " + A.foo);
Unclassified usage (7: 19) A.object$.setFoo("a"); Unclassified usage (7: 19) A.OBJECT$.setFoo("a");
Unclassified usage (8: 11) A.foo = "a"; Unclassified usage (8: 11) A.foo = "a";
Unclassified usage (9: 40) println("a.foo = " + A.object$.getFoo()); Unclassified usage (9: 40) println("a.foo = " + A.OBJECT$.getFoo());
@@ -1,12 +1,12 @@
class ClassObject { class ClassObject {
void foo() { void foo() {
WithClassObject.object$.getValue(); WithClassObject.OBJECT$.getValue();
WithClassObject.object$.getValue(); WithClassObject.OBJECT$.getValue();
WithClassObject.object$.foo(); WithClassObject.OBJECT$.foo();
WithClassObject.object$.getValueWithGetter(); WithClassObject.OBJECT$.getValueWithGetter();
WithClassObject.object$.getVariable(); WithClassObject.OBJECT$.getVariable();
WithClassObject.object$.setVariable(0); WithClassObject.OBJECT$.setVariable(0);
WithClassObject.object$.getVariableWithAccessors(); WithClassObject.OBJECT$.getVariableWithAccessors();
WithClassObject.object$.setVariableWithAccessors(0); WithClassObject.OBJECT$.setVariableWithAccessors(0);
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package a;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
a.Test t = a.Test.instance$; a.Test t = a.Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.*;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package c;
class J { class J {
void bar() { void bar() {
a.Test t = a.Test.instance$; a.Test t = a.Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.*;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import b.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package a;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package b;
class J { class J {
void bar() { void bar() {
a.Test t = a.Test.instance$; a.Test t = a.Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.*;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package c;
class J { class J {
void bar() { void bar() {
a.Test t = a.Test.instance$; a.Test t = a.Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.*;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -4,6 +4,6 @@ import a.Test;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package a;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -2,6 +2,6 @@ package a;
class J { class J {
void bar() { void bar() {
Test t = Test.instance$; Test t = Test.INSTANCE$;
} }
} }
@@ -31,7 +31,7 @@ public abstract class AbstractMultiFileJvmBasicCompletionTest extends KotlinComp
protected void doTest(@NotNull String testPath) throws Exception { protected void doTest(@NotNull String testPath) throws Exception {
configureByFile(getTestName(false) + ".kt", ""); configureByFile(getTestName(false) + ".kt", "");
boolean shouldFail = testPath.contains("NoSpecifiedType"); boolean shouldFail = testPath.contains("NoSpecifiedType");
AstAccessControl.instance$.testWithControlledAccessToAst( AstAccessControl.INSTANCE$.testWithControlledAccessToAst(
shouldFail, getFile().getVirtualFile(), getProject(), getTestRootDisposable(), shouldFail, getFile().getVirtualFile(), getProject(), getTestRootDisposable(),
new Function0<Unit>() { new Function0<Unit>() {
@Override @Override
@@ -43,7 +43,7 @@ public abstract class AbstractMultiFileJvmBasicCompletionTest extends KotlinComp
return myItems; return myItems;
} }
}); });
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -57,13 +57,13 @@ public abstract class AbstractLazyResolveByStubTest extends KotlinCodeInsightTes
configureByFile(path); configureByFile(path);
configureModule(getModule(), JetWithJdkAndRuntimeLightProjectDescriptor.INSTANCE); configureModule(getModule(), JetWithJdkAndRuntimeLightProjectDescriptor.INSTANCE);
boolean shouldFail = getTestName(false).equals("ClassWithConstVal"); boolean shouldFail = getTestName(false).equals("ClassWithConstVal");
AstAccessControl.instance$.testWithControlledAccessToAst( AstAccessControl.INSTANCE$.testWithControlledAccessToAst(
shouldFail, getProject(), getTestRootDisposable(), shouldFail, getProject(), getTestRootDisposable(),
new Function0<Unit>() { new Function0<Unit>() {
@Override @Override
public Unit invoke() { public Unit invoke() {
performTest(path, checkPrimaryConstructors, checkPropertyAccessors); performTest(path, checkPrimaryConstructors, checkPropertyAccessors);
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -71,7 +71,7 @@ public abstract class AbstractLazyResolveByStubTest extends KotlinCodeInsightTes
private void performTest(@NotNull String path, boolean checkPrimaryConstructors, boolean checkPropertyAccessors) { private void performTest(@NotNull String path, boolean checkPrimaryConstructors, boolean checkPropertyAccessors) {
ResolveSessionForBodies resolveSession = ResolveSessionForBodies resolveSession =
KotlinCacheService.object$.getInstance(getFile().getProject()).getLazyResolveSession((JetFile) getFile()); KotlinCacheService.OBJECT$.getInstance(getFile().getProject()).getLazyResolveSession((JetFile) getFile());
ModuleDescriptor module = resolveSession.getModuleDescriptor(); ModuleDescriptor module = resolveSession.getModuleDescriptor();
PackageViewDescriptor packageViewDescriptor = module.getPackage(new FqName("test")); PackageViewDescriptor packageViewDescriptor = module.getPackage(new FqName("test"));
Assert.assertNotNull(packageViewDescriptor); Assert.assertNotNull(packageViewDescriptor);
@@ -41,13 +41,13 @@ public abstract class AbstractMultiFileHighlightingTest extends KotlinCompletion
public void doTest(@NotNull String filePath) throws Exception { public void doTest(@NotNull String filePath) throws Exception {
configureByFile(new File(filePath).getName(), ""); configureByFile(new File(filePath).getName(), "");
boolean shouldFail = getName().contains("UnspecifiedType"); boolean shouldFail = getName().contains("UnspecifiedType");
AstAccessControl.instance$.testWithControlledAccessToAst( AstAccessControl.INSTANCE$.testWithControlledAccessToAst(
shouldFail, getFile().getVirtualFile(), getProject(), getTestRootDisposable(), shouldFail, getFile().getVirtualFile(), getProject(), getTestRootDisposable(),
new Function0<Unit>() { new Function0<Unit>() {
@Override @Override
public Unit invoke() { public Unit invoke() {
checkHighlighting(myEditor, true, false); checkHighlighting(myEditor, true, false);
return Unit.instance$; return Unit.INSTANCE$;
} }
} }
); );
@@ -4,7 +4,7 @@ import kotlinApi.KotlinClass;
class C { class C {
int foo() { int foo() {
KotlinClass.staticVar = KotlinClass.staticVar * 2; KotlinClass.staticVar = KotlinClass.staticVar * 2;
KotlinClass.object$.setStaticProperty(KotlinClass.object$.getStaticVar() + KotlinClass.object$.getStaticProperty()); KotlinClass.OBJECT$.setStaticProperty(KotlinClass.OBJECT$.getStaticVar() + KotlinClass.OBJECT$.getStaticProperty());
return KotlinClass.object$.staticFun(1); return KotlinClass.OBJECT$.staticFun(1);
} }
} }
@@ -5,10 +5,10 @@ class A {
int foo(KotlinClass c) { int foo(KotlinClass c) {
return c.getNullableProperty().length() return c.getNullableProperty().length()
+ c.getProperty().length() + c.getProperty().length()
+ KotlinClass.object$.getNullableStaticVar() + KotlinClass.OBJECT$.getNullableStaticVar()
+ KotlinClass.object$.getStaticVar() + KotlinClass.OBJECT$.getStaticVar()
+ KotlinClass.object$.nullableStaticFun(1) + KotlinClass.OBJECT$.nullableStaticFun(1)
+ KotlinClass.object$.staticFun(1) + KotlinClass.OBJECT$.staticFun(1)
+ KotlinApiPackage.nullableGlobalFunction("").length() + KotlinApiPackage.nullableGlobalFunction("").length()
+ KotlinApiPackage.globalFunction("").length(); + KotlinApiPackage.globalFunction("").length();
} }
@@ -3,10 +3,10 @@ import kotlinApi.KotlinObject;
class C { class C {
int foo() { int foo() {
KotlinObject.instance$.setProperty1(1); KotlinObject.INSTANCE$.setProperty1(1);
KotlinObject.instance$.setProperty2(2); KotlinObject.INSTANCE$.setProperty2(2);
return KotlinObject.instance$.foo() + return KotlinObject.INSTANCE$.foo() +
KotlinObject.instance$.getProperty1() + KotlinObject.INSTANCE$.getProperty1() +
KotlinObject.instance$.getProperty2(); KotlinObject.INSTANCE$.getProperty2();
} }
} }
@@ -136,7 +136,7 @@ public final class AnalyzerFacadeForJS {
@NotNull Config config @NotNull Config config
) { ) {
GlobalContextImpl globalContext = ContextPackage.GlobalContext(); GlobalContextImpl globalContext = ContextPackage.GlobalContext();
DeclarationProviderFactory declarationProviderFactory = DeclarationProviderFactoryService.object$ DeclarationProviderFactory declarationProviderFactory = DeclarationProviderFactoryService.OBJECT$
.createDeclarationProviderFactory( .createDeclarationProviderFactory(
config.getProject(), config.getProject(),
globalContext.getStorageManager(), globalContext.getStorageManager(),
@@ -141,7 +141,7 @@ public final class PropertyTranslator extends AbstractTranslator {
JsExpression value; JsExpression value;
ResolvedCall<FunctionDescriptor> delegatedCall = bindingContext().get(BindingContext.DELEGATED_PROPERTY_RESOLVED_CALL, getterDescriptor); ResolvedCall<FunctionDescriptor> delegatedCall = bindingContext().get(BindingContext.DELEGATED_PROPERTY_RESOLVED_CALL, getterDescriptor);
if (delegatedCall != null) { if (delegatedCall != null) {
value = CallTranslator.instance$.translate(context(), delegatedCall, getDelegateNameRef(getPropertyName())); value = CallTranslator.INSTANCE$.translate(context(), delegatedCall, getDelegateNameRef(getPropertyName()));
} else { } else {
value = backingFieldReference(context(), this.descriptor); value = backingFieldReference(context(), this.descriptor);
} }
@@ -171,7 +171,7 @@ public final class PropertyTranslator extends AbstractTranslator {
ResolvedCall<FunctionDescriptor> delegatedCall = bindingContext().get(BindingContext.DELEGATED_PROPERTY_RESOLVED_CALL, ResolvedCall<FunctionDescriptor> delegatedCall = bindingContext().get(BindingContext.DELEGATED_PROPERTY_RESOLVED_CALL,
setterDescriptor); setterDescriptor);
if (delegatedCall != null) { if (delegatedCall != null) {
setExpression = CallTranslator.instance$.translate(contextWithAliased, delegatedCall, getDelegateNameRef(getPropertyName())); setExpression = CallTranslator.INSTANCE$.translate(contextWithAliased, delegatedCall, getDelegateNameRef(getPropertyName()));
} else { } else {
setExpression = assignmentToBackingField(contextWithAliased, descriptor, defaultParameterRef); setExpression = assignmentToBackingField(contextWithAliased, descriptor, defaultParameterRef);
} }
@@ -78,7 +78,7 @@ public class MultiDeclarationTranslator extends AbstractTranslator {
for (JetMultiDeclarationEntry entry : multiDeclaration.getEntries()) { for (JetMultiDeclarationEntry entry : multiDeclaration.getEntries()) {
ResolvedCall<FunctionDescriptor> entryInitCall = context().bindingContext().get(BindingContext.COMPONENT_RESOLVED_CALL, entry); ResolvedCall<FunctionDescriptor> entryInitCall = context().bindingContext().get(BindingContext.COMPONENT_RESOLVED_CALL, entry);
assert entryInitCall != null : "Entry init call must be not null"; assert entryInitCall != null : "Entry init call must be not null";
JsExpression entryInitializer = CallTranslator.instance$.translate(context(), entryInitCall, multiObjNameRef); JsExpression entryInitializer = CallTranslator.INSTANCE$.translate(context(), entryInitCall, multiObjNameRef);
VariableDescriptor descriptor = BindingContextUtils.getNotNull( context().bindingContext(), BindingContext.VARIABLE, entry); VariableDescriptor descriptor = BindingContextUtils.getNotNull( context().bindingContext(), BindingContext.VARIABLE, entry);
JsName name = context().getNameForDescriptor(descriptor); JsName name = context().getNameForDescriptor(descriptor);

Some files were not shown because too many files have changed in this diff Show More