Deprecated 'INSTANCE$' replaced with 'INSTANCE'

This commit is contained in:
Michael Bogdanov
2015-12-24 10:36:13 +03:00
parent 80fd9e3cbb
commit aeb6486473
98 changed files with 187 additions and 187 deletions
@@ -26,7 +26,7 @@ public class JsEmptyExpression extends JsExpressionImpl {
@Override
@NotNull
public JsStatement makeStmt() {
return JsEmpty.INSTANCE$;
return JsEmpty.INSTANCE;
}
@Override
@@ -48,7 +48,7 @@ public final class TopDownAnalyzerFacadeForJS {
BindingTrace trace = new BindingTraceContext();
MutableModuleContext newModuleContext = ContextKt.ContextForNewModule(
config.getProject(), Name.special("<" + config.getModuleId() + ">"), JsPlatform.INSTANCE$
config.getProject(), Name.special("<" + config.getModuleId() + ">"), JsPlatform.INSTANCE
);
newModuleContext.setDependencies(computeDependencies(newModuleContext.getModule(), config));
return analyzeFilesWithGivenTrace(files, trace, newModuleContext, config);
@@ -59,7 +59,7 @@ public final class TopDownAnalyzerFacadeForJS {
List<ModuleDescriptorImpl> allDependencies = new ArrayList<ModuleDescriptorImpl>();
allDependencies.add(module);
allDependencies.addAll(config.getModuleDescriptors());
allDependencies.add(JsPlatform.INSTANCE$.getBuiltIns().getBuiltInsModule());
allDependencies.add(JsPlatform.INSTANCE.getBuiltIns().getBuiltInsModule());
return allDependencies;
}
@@ -160,19 +160,19 @@ public abstract class Config {
", but metadata.abiVersion = " + metadata.getAbiVersion();
ModuleDescriptorImpl moduleDescriptor = TargetPlatformKt.createModule(
JsPlatform.INSTANCE$, Name.special("<" + metadata.getModuleName() + ">"), storageManager
JsPlatform.INSTANCE, Name.special("<" + metadata.getModuleName() + ">"), storageManager
);
PackageFragmentProvider provider =
KotlinJavascriptSerializationUtil.createPackageFragmentProvider(moduleDescriptor, metadata.getBody(), storageManager);
moduleDescriptor.initialize(provider != null ? provider : PackageFragmentProvider.Empty.INSTANCE$);
moduleDescriptor.initialize(provider != null ? provider : PackageFragmentProvider.Empty.INSTANCE);
return moduleDescriptor;
}
private static void setDependencies(ModuleDescriptorImpl module, List<ModuleDescriptorImpl> modules) {
module.setDependencies(CollectionsKt.plus(modules, JsPlatform.INSTANCE$.getBuiltIns().getBuiltInsModule()));
module.setDependencies(CollectionsKt.plus(modules, JsPlatform.INSTANCE.getBuiltIns().getBuiltInsModule()));
}
@NotNull
@@ -114,7 +114,7 @@ public class LibrarySourcesConfig extends Config {
metadata.addAll(KotlinJavascriptMetadataUtils.loadMetadata(libraryPath));
}
return Unit.INSTANCE$;
return Unit.INSTANCE;
}
};
@@ -37,8 +37,8 @@ public interface ErrorsJs {
DiagnosticFactory0<KtDeclaration> NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE = DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE);
DiagnosticFactory0<KtDeclaration> NATIVE_SETTER_WRONG_RETURN_TYPE = DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE);
DiagnosticFactory2<KtElement, Integer, String> NATIVE_INDEXER_WRONG_PARAMETER_COUNT = DiagnosticFactory2.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
DiagnosticFactory1<KtExpression, JsCallData> JSCODE_ERROR = DiagnosticFactory1.create(ERROR, JsCodePositioningStrategy.INSTANCE$);
DiagnosticFactory1<KtExpression, JsCallData> JSCODE_WARNING = DiagnosticFactory1.create(WARNING, JsCodePositioningStrategy.INSTANCE$);
DiagnosticFactory1<KtExpression, JsCallData> JSCODE_ERROR = DiagnosticFactory1.create(ERROR, JsCodePositioningStrategy.INSTANCE);
DiagnosticFactory1<KtExpression, JsCallData> JSCODE_WARNING = DiagnosticFactory1.create(WARNING, JsCodePositioningStrategy.INSTANCE);
DiagnosticFactory0<KtExpression> JSCODE_ARGUMENT_SHOULD_BE_CONSTANT = DiagnosticFactory0.create(ERROR, DEFAULT);
DiagnosticFactory1<KtElement, KtElement> NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
DiagnosticFactory1<KtElement, KtElement> REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
@@ -517,7 +517,7 @@ public class JsAstMapper {
toForIn.setBody(bodyStmt);
}
else {
toForIn.setBody(JsEmpty.INSTANCE$);
toForIn.setBody(JsEmpty.INSTANCE);
}
return toForIn;
@@ -545,7 +545,7 @@ public class JsAstMapper {
toFor.setBody(bodyStmt);
}
else {
toFor.setBody(JsEmpty.INSTANCE$);
toFor.setBody(JsEmpty.INSTANCE);
}
return toFor;
}
@@ -892,7 +892,7 @@ public class JsAstMapper {
else {
// When map() returns null, we return an empty statement.
//
return JsEmpty.INSTANCE$;
return JsEmpty.INSTANCE;
}
}
@@ -46,8 +46,8 @@ public final class Namer {
public static final JsNameRef KOTLIN_OBJECT_REF = new JsNameRef(KOTLIN_NAME);
public static final JsNameRef KOTLIN_LONG_NAME_REF = new JsNameRef("Long", KOTLIN_OBJECT_REF);
public static final String EQUALS_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE$.getBuiltIns().getAny(), "equals");
public static final String COMPARE_TO_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE$.getBuiltIns().getComparable(), "compareTo");
public static final String EQUALS_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE.getBuiltIns().getAny(), "equals");
public static final String COMPARE_TO_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE.getBuiltIns().getComparable(), "compareTo");
public static final String NUMBER_RANGE = "NumberRange";
public static final String CHAR_RANGE = "CharRange";
public static final String LONG_FROM_NUMBER = "fromNumber";
@@ -243,7 +243,7 @@ public final class StaticContext {
public JsName apply(@NotNull DeclarationDescriptor descriptor) {
if (isDynamic(descriptor)) {
String name = descriptor.getName().asString();
return JsDynamicScope.INSTANCE$.declareName(name);
return JsDynamicScope.INSTANCE.declareName(name);
}
return null;
@@ -159,7 +159,7 @@ public final class ExpressionVisitor extends TranslatorVisitor<JsNode> {
if (expressionInside != null) {
return Translation.translateExpression(expressionInside, context);
}
return JsEmpty.INSTANCE$;
return JsEmpty.INSTANCE;
}
@Override
@@ -191,7 +191,7 @@ public final class ExpressionVisitor extends TranslatorVisitor<JsNode> {
@Override
@NotNull
public JsNode visitCallableReferenceExpression(@NotNull KtCallableReferenceExpression expression, @NotNull TranslationContext context) {
return CallableReferenceTranslator.INSTANCE$.translate(expression, context);
return CallableReferenceTranslator.INSTANCE.translate(expression, context);
}
@Override
@@ -63,7 +63,7 @@ public final class WhenTranslator extends AbstractTranslator {
private JsStatement translate() {
if (expressionToMatch != null && JsAstUtils.isEmptyExpression(expressionToMatch)) {
return JsEmpty.INSTANCE$;
return JsEmpty.INSTANCE;
}
JsIf currentIf = null;
@@ -232,6 +232,6 @@ public final class Translation {
}
FunctionDescriptor functionDescriptor = getFunctionDescriptor(context.bindingContext(), mainFunction);
JsArrayLiteral argument = new JsArrayLiteral(toStringLiteralList(arguments, context.program()));
return CallTranslator.INSTANCE$.buildCall(context, functionDescriptor, Collections.singletonList(argument), null).makeStmt();
return CallTranslator.INSTANCE.buildCall(context, functionDescriptor, Collections.singletonList(argument), null).makeStmt();
}
}
@@ -40,13 +40,13 @@ public final class FunctionIntrinsics {
}
private void registerFactories() {
register(LongOperationFIF.INSTANCE$);
register(LongOperationFIF.INSTANCE);
register(PrimitiveUnaryOperationFIF.INSTANCE);
register(PrimitiveBinaryOperationFIF.INSTANCE);
register(StringOperationFIF.INSTANCE);
register(ArrayFIF.INSTANCE);
register(TopLevelFIF.INSTANCE);
register(NumberAndCharConversionFIF.INSTANCE$);
register(NumberAndCharConversionFIF.INSTANCE);
register(ProgressionCompanionFIF.INSTANCE);
}
@@ -200,7 +200,7 @@ public final class TopLevelFIF extends CompositeFIF {
}
}
String mangledName = getStableMangledNameForDescriptor(JsPlatform.INSTANCE$.getBuiltIns().getMutableMap(), operationName());
String mangledName = getStableMangledNameForDescriptor(JsPlatform.INSTANCE.getBuiltIns().getMutableMap(), operationName());
return new JsInvocation(new JsNameRef(mangledName, thisOrReceiver), arguments);
}
@@ -131,6 +131,6 @@ public final class CallExpressionTranslator extends AbstractCallExpressionTransl
assert currentScope instanceof JsFunctionScope : "Usage of js outside of function is unexpected";
JsScope temporaryRootScope = new JsRootScope(new JsProgram("<js code>"));
JsScope scope = new DelegatingJsFunctionScopeWithTemporaryParent((JsFunctionScope) currentScope, temporaryRootScope);
return ParserUtilsKt.parse(jsCode, ThrowExceptionOnErrorReporter.INSTANCE$, scope);
return ParserUtilsKt.parse(jsCode, ThrowExceptionOnErrorReporter.INSTANCE, scope);
}
}
@@ -63,13 +63,13 @@ public class VariableAccessTranslator extends AbstractTranslator implements Acce
@NotNull
@Override
public JsExpression translateAsGet() {
return CallTranslator.INSTANCE$.translateGet(context(), resolvedCall, receiver);
return CallTranslator.INSTANCE.translateGet(context(), resolvedCall, receiver);
}
@NotNull
@Override
public JsExpression translateAsSet(@NotNull JsExpression setTo) {
return CallTranslator.INSTANCE$.translateSet(context(), resolvedCall, setTo, receiver);
return CallTranslator.INSTANCE.translateSet(context(), resolvedCall, setTo, receiver);
}
@NotNull
@@ -60,7 +60,7 @@ public final class JSTestGenerator {
@NotNull ClassDescriptor classDescriptor, @NotNull JSTester tester) {
JsExpression expression = ReferenceTranslator.translateAsFQReference(classDescriptor, context);
JsNew testClass = new JsNew(expression);
JsExpression functionToTestCall = CallTranslator.INSTANCE$.buildCall(context, functionDescriptor,
JsExpression functionToTestCall = CallTranslator.INSTANCE.buildCall(context, functionDescriptor,
Collections.<JsExpression>emptyList(), testClass);
JsStringLiteral testName = context.program().getStringLiteral(classDescriptor.getName() + "." + functionDescriptor.getName());
tester.constructTestMethodInvocation(functionToTestCall, testName);