diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 10829573d27..834c3b10910 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -1908,7 +1908,7 @@ public class ExpressionCodegen extends JetVisitor implem if (descriptor instanceof PropertyDescriptor) { PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor; - Collection codegenExtensions = ExpressionCodegenExtension.Default.getInstances(state.getProject()); + Collection codegenExtensions = ExpressionCodegenExtension.OBJECT$.getInstances(state.getProject()); if (!codegenExtensions.isEmpty() && resolvedCall != null) { ExpressionCodegenExtension.Context context = new ExpressionCodegenExtension.Context(typeMapper, v); JetType returnType = propertyDescriptor.getReturnType(); @@ -2348,7 +2348,7 @@ public class ExpressionCodegen extends JetVisitor implem if (!(resolvedCall.getResultingDescriptor() instanceof ConstructorDescriptor)) { // otherwise already receiver = StackValue.receiver(resolvedCall, receiver, this, callableMethod); - Collection codegenExtensions = ExpressionCodegenExtension.Default.getInstances(state.getProject()); + Collection codegenExtensions = ExpressionCodegenExtension.OBJECT$.getInstances(state.getProject()); if (!codegenExtensions.isEmpty()) { ExpressionCodegenExtension.Context context = new ExpressionCodegenExtension.Context(typeMapper, v); for (ExpressionCodegenExtension extension : codegenExtensions) { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index ec37278e989..d508b5bc3a3 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -388,7 +388,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { genClosureFields(context.closure, v, typeMapper); - for (ExpressionCodegenExtension extension : ExpressionCodegenExtension.Default.getInstances(state.getProject())) { + for (ExpressionCodegenExtension extension : ExpressionCodegenExtension.OBJECT$.getInstances(state.getProject())) { extension.generateClassSyntheticParts(v, state, myClass, descriptor); } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PlatformStaticGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/PlatformStaticGenerator.kt index e367710abfd..8330c006e06 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PlatformStaticGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/PlatformStaticGenerator.kt @@ -76,7 +76,7 @@ class PlatformStaticGenerator( ) } - default object { + class object { [platformStatic] public fun createStaticFunctionDescriptor(descriptor: FunctionDescriptor): FunctionDescriptor { val memberDescriptor = if (descriptor is PropertyAccessorDescriptor) descriptor.getCorrespondingProperty() else descriptor diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/extensions/ExpressionCodegenExtension.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/extensions/ExpressionCodegenExtension.kt index 845b8655a00..eb23bea6f46 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/extensions/ExpressionCodegenExtension.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/extensions/ExpressionCodegenExtension.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.resolve.* public trait ExpressionCodegenExtension { - default object : ProjectExtensionDescriptor("org.jetbrains.kotlin.expressionCodegenExtension", javaClass()) + class object : ProjectExtensionDescriptor("org.jetbrains.kotlin.expressionCodegenExtension", javaClass()) public class Context( public val typeMapper: JetTypeMapper, diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/ReifiedTypeInliner.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/ReifiedTypeInliner.kt index d26d572f93f..1f3fd198b38 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/ReifiedTypeInliner.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/ReifiedTypeInliner.kt @@ -34,7 +34,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils public class ReifiedTypeInliner(private val parametersMapping: ReifiedTypeParameterMappings?) { - default object { + class object { public val NEW_ARRAY_MARKER_METHOD_NAME: String = "reifyNewArray" public val CHECKCAST_MARKER_METHOD_NAME: String = "reifyCheckcast" public val INSTANCEOF_MARKER_METHOD_NAME: String = "reifyInstanceof" diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/annotationArgumentsImpl.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/annotationArgumentsImpl.kt index bfa1db4b5db..dc9eba066cc 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/annotationArgumentsImpl.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/annotationArgumentsImpl.kt @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.name.Name abstract class JavaAnnotationArgumentImpl( override val name: Name? ) : JavaAnnotationArgument { - default object Factory { + class object Factory { fun create(argument: PsiAnnotationMemberValue, name: Name?): JavaAnnotationArgument { val value = JavaPsiFacade.getInstance(argument.getProject()).getConstantEvaluationHelper().computeConstantExpression(argument) if (value is Enum<*>) { diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/VirtualFileKotlinClass.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/VirtualFileKotlinClass.kt index 3c964a723a8..65c68e52f2f 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/VirtualFileKotlinClass.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/VirtualFileKotlinClass.kt @@ -49,7 +49,7 @@ public class VirtualFileKotlinClass private( override fun hashCode() = file.hashCode() override fun toString() = "${javaClass.getSimpleName()}: $file" - default object Factory { + class object Factory { private val LOG = Logger.getInstance(javaClass()) deprecated("Use KotlinBinaryClassCache") diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt index 1c0f24ee8c4..275abfaff3b 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt @@ -47,7 +47,7 @@ public class JvmDeclarationOrigin( public val element: PsiElement?, public val descriptor: DeclarationDescriptor? ) { - default object { + class object { public val NO_ORIGIN: JvmDeclarationOrigin = JvmDeclarationOrigin(OTHER, null, null) } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalysisResult.kt b/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalysisResult.kt index 2e6b270f5fb..09eb88563ab 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalysisResult.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalysisResult.kt @@ -39,7 +39,7 @@ public data open class AnalysisResult protected ( private class Error(bindingContext: BindingContext, val exception: Throwable) : AnalysisResult(bindingContext, ErrorUtils.getErrorModule()) - default object { + class object { public val EMPTY: AnalysisResult = success(BindingContext.EMPTY, ErrorUtils.getErrorModule()) platformStatic public fun success(bindingContext: BindingContext, module: ModuleDescriptor): AnalysisResult { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/accessInstructions.kt b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/accessInstructions.kt index d554ce6b554..5414451dea3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/accessInstructions.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/accessInstructions.kt @@ -75,7 +75,7 @@ public class ReadValueInstruction private ( override fun createCopy(): InstructionImpl = ReadValueInstruction(element, lexicalScope, target, receiverValues, outputValue) - default object Factory { + class object Factory { public fun create ( element: JetElement, lexicalScope: LexicalScope, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/operationInstructions.kt b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/operationInstructions.kt index b5cb5281ac5..b3123b175b5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/operationInstructions.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/instructions/eval/operationInstructions.kt @@ -79,7 +79,7 @@ public class CallInstruction private( override fun toString() = renderInstruction("call", "${render(element)}, ${resolvedCall.getResultingDescriptor()!!.getName()}") - default object Factory { + class object Factory { fun create ( element: JetElement, lexicalScope: LexicalScope, @@ -115,7 +115,7 @@ public class MagicInstruction( override fun toString() = renderInstruction("magic[$kind]", render(element)) - default object Factory { + class object Factory { fun create( element: JetElement, valueElement: JetElement?, @@ -165,7 +165,7 @@ class MergeInstruction private( override fun toString() = renderInstruction("merge", render(element)) - default object Factory { + class object Factory { fun create( element: JetElement, lexicalScope: LexicalScope, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/extensions/ExternalDeclarationsProvider.kt b/compiler/frontend/src/org/jetbrains/kotlin/extensions/ExternalDeclarationsProvider.kt index 34647cb56c4..0afb5d46da1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/extensions/ExternalDeclarationsProvider.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/extensions/ExternalDeclarationsProvider.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.analyzer.ModuleInfo import org.jetbrains.kotlin.psi.JetFile public trait ExternalDeclarationsProvider { - default object : ProjectExtensionDescriptor( + class object : ProjectExtensionDescriptor( "org.jetbrains.kotlin.externalDeclarationsProvider", javaClass() ) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt b/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt index dce30134c1c..0d2b9d16820 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/kdoc/parser/KDocLinkParser.kt @@ -29,7 +29,7 @@ import kotlin.platform.* * Parses the contents of a Markdown link in KDoc. Uses the standard Kotlin lexer. */ class KDocLinkParser(): PsiParser { - default object { + class object { platformStatic public fun parseMarkdownLink(root: IElementType, chameleon: ASTNode): ASTNode { val parentElement = chameleon.getTreeParent().getPsi() val project = parentElement.getProject() diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetCodeFragment.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetCodeFragment.kt index 7d14723f3bf..5e82ddb1628 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetCodeFragment.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetCodeFragment.kt @@ -147,7 +147,7 @@ public abstract class JetCodeFragment( } } - default object { + class object { public val IMPORT_SEPARATOR: String = "," public val RUNTIME_TYPE_EVALUATOR: Key> = Key.create("RUNTIME_TYPE_EVALUATOR") } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSimpleNameExpression.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSimpleNameExpression.kt index 1cf0508baea..7416bae2fa1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSimpleNameExpression.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSimpleNameExpression.kt @@ -50,7 +50,7 @@ abstract class JetSimpleNameExpressionImpl(node: ASTNode) : JetExpressionImpl(no override fun getReferencedName() = getReferencedNameImpl() //NOTE: an unfortunate way to share an implementation between stubbed and not stubbed tree - default object Helper { + class object Helper { fun JetSimpleNameExpression.getReferencedNameElementTypeImpl(): IElementType { return this.getReferencedNameElement().getNode()!!.getElementType()!! diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinStubBaseImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinStubBaseImpl.kt index 5d83f3f2130..c126647fd95 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinStubBaseImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinStubBaseImpl.kt @@ -73,7 +73,7 @@ public open class KotlinStubBaseImpl>(parent: StubElem return methodName } - default object { + class object { private val LOGGER: Logger = Logger.getInstance(javaClass>>()) private val BASE_STUB_INTERFACES = listOf(javaClass>(), javaClass>(), javaClass>()) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/CodeAnalyzerInitializer.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/CodeAnalyzerInitializer.kt index 9ad2c3221b6..cde3f0392eb 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/CodeAnalyzerInitializer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/CodeAnalyzerInitializer.kt @@ -25,7 +25,7 @@ public trait CodeAnalyzerInitializer { public fun initialize(trace: BindingTrace, module: ModuleDescriptor, codeAnalyzer: KotlinCodeAnalyzer?) public fun createTrace(): BindingTrace - default object { + class object { public fun getInstance(project: Project): CodeAnalyzerInitializer = ServiceManager.getService(project, javaClass())!! } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/CompositeBindingContext.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/CompositeBindingContext.kt index d6fe69c8152..ec63b349312 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/CompositeBindingContext.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/CompositeBindingContext.kt @@ -28,7 +28,7 @@ public class CompositeBindingContext private ( private val delegates: List ) : BindingContext { - default object { + class object { public fun create(delegates: List): BindingContext { if (delegates.isEmpty()) return BindingContext.EMPTY if (delegates.size() == 1) return delegates.first() diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/StatementFilter.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/StatementFilter.kt index ba62f2e27e1..bef31c129d3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/StatementFilter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/StatementFilter.kt @@ -25,7 +25,7 @@ public open class StatementFilter { public open val filter: ((JetElement) -> Boolean)? get() = null - default object { + class object { public val NONE: StatementFilter = StatementFilter() } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt index e9ff79af968..7c30329da55 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt @@ -306,7 +306,7 @@ public class TypeResolver( return classifierDescriptor } - default object { + class object { [platformStatic] public fun resolveProjectionKind(projectionKind: JetProjectionKind): Variance { return when (projectionKind) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt index 4417530ed83..d0004ab72a0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt @@ -79,7 +79,7 @@ class VarianceChecker(private val trace: BindingTrace) { val occurrencePosition: Variance ) - default object { + class object { platformStatic fun recordPrivateToThisIfNeeded(trace: BindingTrace, descriptor: CallableMemberDescriptor) { if (isIrrelevant(descriptor) || descriptor.getVisibility() != Visibilities.PRIVATE) return diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/CallableDescriptorCollectors.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/CallableDescriptorCollectors.kt index 434b7531302..0dab7a9f754 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/CallableDescriptorCollectors.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/CallableDescriptorCollectors.kt @@ -47,8 +47,8 @@ public class CallableDescriptorCollectors(val collectors Iterable> { override fun iterator(): Iterator> = collectors.iterator() - [suppress("UNCHECKED_CAST")] default - object { + [suppress("UNCHECKED_CAST")] + class object { public val FUNCTIONS_AND_VARIABLES: CallableDescriptorCollectors = CallableDescriptorCollectors(listOf( FUNCTIONS_COLLECTOR as CallableDescriptorCollector, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt index 0fa8d2e99a9..27c6ea20cba 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/ConstantExpressionEvaluator.kt @@ -38,7 +38,7 @@ import kotlin.platform.platformStatic public class ConstantExpressionEvaluator private (val trace: BindingTrace) : JetVisitor, JetType>() { - default object { + class object { platformStatic public fun evaluate(expression: JetExpression, trace: BindingTrace, expectedType: JetType? = TypeUtils.NO_EXPECTED_TYPE): CompileTimeConstant<*>? { val evaluator = ConstantExpressionEvaluator(trace) return evaluator.evaluate(expression, expectedType) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/diagnostics/Diagnostics.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/diagnostics/Diagnostics.kt index f3c72757f11..036c7e25500 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/diagnostics/Diagnostics.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/diagnostics/Diagnostics.kt @@ -36,7 +36,7 @@ public trait Diagnostics : Iterable { override fun iterator() = all().iterator() - default object { + class object { public val EMPTY: Diagnostics = object : Diagnostics { override fun noSuppression(): Diagnostics = this override val modificationTracker: ModificationTracker = ModificationTracker.NEVER_CHANGED diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyFileScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyFileScope.kt index ce16a5ca5c6..37f6dc46ebe 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyFileScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyFileScope.kt @@ -55,7 +55,7 @@ class LazyFileScope private( } } - default object Factory { + class object Factory { public fun create( resolveSession: ResolveSession, file: JetFile, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/DeclarationProviderFactoryService.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/DeclarationProviderFactoryService.kt index 51e41802629..30eeb4108c2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/DeclarationProviderFactoryService.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/DeclarationProviderFactoryService.kt @@ -35,7 +35,7 @@ public abstract class DeclarationProviderFactoryService { filesScope: GlobalSearchScope ): DeclarationProviderFactory - default object { + class object { public platformStatic fun createDeclarationProviderFactory( project: Project, storageManager: StorageManager, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt index 2021233f6cd..e694ff0e0f4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt @@ -319,7 +319,7 @@ public open class LazyClassMemberScope( // Do not add details here, they may compromise the laziness during debugging override fun toString() = "lazy scope for class ${thisDescriptor.getName()}" - default object { + class object { private val EXTRACT_FUNCTIONS: MemberExtractor = object : MemberExtractor { override fun extract(extractFrom: JetType, name: Name): Collection { return extractFrom.getMemberScope().getFunctions(name) diff --git a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinCodeBlockModificationListener.kt b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinCodeBlockModificationListener.kt index f6d04081f96..e84cefac0af 100644 --- a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinCodeBlockModificationListener.kt +++ b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinCodeBlockModificationListener.kt @@ -87,7 +87,7 @@ public class KotlinCodeBlockModificationListener(modificationTracker: PsiModific } } - default object { + class object { private val LOG = Logger.getInstance("#org.jetbrains.kotlin.asJava.JetCodeBlockModificationListener") private fun containsClassesInside(element: PsiElement?): Boolean { diff --git a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt index cdc514763af..465b4257a52 100644 --- a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt +++ b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt @@ -65,7 +65,7 @@ public class KotlinLightClassForPackage private( } } - default object { + class object { public fun getInstance(project: Project): FileStubCache { return ServiceManager.getService(project, javaClass()) } @@ -214,7 +214,7 @@ public class KotlinLightClassForPackage private( } } - default object Factory { + class object Factory { public fun create( manager: PsiManager, qualifiedName: FqName, diff --git a/compiler/plugin-api/src/org/jetbrains/kotlin/compiler/plugin/ComponentRegistrar.kt b/compiler/plugin-api/src/org/jetbrains/kotlin/compiler/plugin/ComponentRegistrar.kt index 8c8427365d5..e33137f2f90 100644 --- a/compiler/plugin-api/src/org/jetbrains/kotlin/compiler/plugin/ComponentRegistrar.kt +++ b/compiler/plugin-api/src/org/jetbrains/kotlin/compiler/plugin/ComponentRegistrar.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.config.CompilerConfigurationKey import org.jetbrains.kotlin.config.CompilerConfiguration public trait ComponentRegistrar { - default object { + class object { public val PLUGIN_COMPONENT_REGISTRARS: CompilerConfigurationKey> = CompilerConfigurationKey.create("plugin component registrars") } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt index 050205bf926..54caebe7739 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt @@ -93,7 +93,7 @@ public trait AbstractSMAPBaseTest { } class SMAPAndFile(val smap: String?, val sourceFile: String) { - default object { + class object { fun SMAPAndFile(smap: String?, sourceFile: File) = SMAPAndFile(smap, getPath(sourceFile)) public fun getPath(file: File): String { diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/MultiModuleJavaAnalysisCustomTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/MultiModuleJavaAnalysisCustomTest.kt index 6093105d20f..da2cc9316c2 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/MultiModuleJavaAnalysisCustomTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/MultiModuleJavaAnalysisCustomTest.kt @@ -165,7 +165,7 @@ public class MultiModuleJavaAnalysisCustomTest : UsefulTestCase() { ) } - default object { + class object { val PATH_TO_TEST_ROOT_DIR = "compiler/testData/multiModule/java/custom" } } diff --git a/compiler/tests/org/jetbrains/kotlin/resolve/constants/evaluate/AbstractEvaluateExpressionTest.kt b/compiler/tests/org/jetbrains/kotlin/resolve/constants/evaluate/AbstractEvaluateExpressionTest.kt index 94dd36a0d9c..f113a73afc5 100644 --- a/compiler/tests/org/jetbrains/kotlin/resolve/constants/evaluate/AbstractEvaluateExpressionTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/resolve/constants/evaluate/AbstractEvaluateExpressionTest.kt @@ -108,7 +108,7 @@ public abstract class AbstractEvaluateExpressionTest : AbstractAnnotationDescrip } } - default object { + class object { val pattern = Pattern.compile(".+(?=:)") } } diff --git a/compiler/util/src/org/jetbrains/kotlin/config/Services.kt b/compiler/util/src/org/jetbrains/kotlin/config/Services.kt index 841d8a0b1b1..81f30f87707 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/Services.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/Services.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.config import java.util.HashMap public class Services private(private val map: Map, Any>) { - default object { + class object { public val EMPTY: Services = Builder().build() } diff --git a/core/builtins/native/kotlin/Enum.kt b/core/builtins/native/kotlin/Enum.kt index 5d290eacfd3..7eb3d65f627 100644 --- a/core/builtins/native/kotlin/Enum.kt +++ b/core/builtins/native/kotlin/Enum.kt @@ -22,7 +22,7 @@ package kotlin * information on enum classes. */ public abstract class Enum>(name: String, ordinal: Int): Comparable { - default object {} + class object Companion {} /** * Returns the name of this enum constant, exactly as declared in its enum declaration. diff --git a/core/builtins/native/kotlin/Primitives.kt b/core/builtins/native/kotlin/Primitives.kt index d441ae772bf..df00df81d1a 100644 --- a/core/builtins/native/kotlin/Primitives.kt +++ b/core/builtins/native/kotlin/Primitives.kt @@ -23,7 +23,7 @@ package kotlin * On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`. */ public class Byte private () : Number, Comparable { - default object {} + class object Companion {} /** * Compares this value with the specified value for order. @@ -181,7 +181,7 @@ public class Byte private () : Number, Comparable { * On the JVM, non-nullable values of this type are represented as values of the primitive type `char`. */ public class Char private () : Comparable { - default object {} + class object Companion {} /** * Compares the character code of this character with the specified value for order. @@ -326,7 +326,7 @@ public class Char private () : Comparable { * On the JVM, non-nullable values of this type are represented as values of the primitive type `short`. */ public class Short private () : Number, Comparable { - default object {} + class object Companion {} /** * Compares this value with the specified value for order. @@ -484,7 +484,7 @@ public class Short private () : Number, Comparable { * On the JVM, non-nullable values of this type are represented as values of the primitive type `int`. */ public class Int private () : Number, Comparable { - default object {} + class object Companion {} /** * Compares this value with the specified value for order. @@ -657,7 +657,7 @@ public class Int private () : Number, Comparable { * On the JVM, non-nullable values of this type are represented as values of the primitive type `long`. */ public class Long private () : Number, Comparable { - default object {} + class object Companion {} /** * Compares this value with the specified value for order. @@ -830,7 +830,7 @@ public class Long private () : Number, Comparable { * On the JVM, non-nullable values of this type are represented as values of the primitive type `float`. */ public class Float private () : Number, Comparable { - default object : FloatingPointConstants {} + class object Companion : FloatingPointConstants {} /** * Compares this value with the specified value for order. @@ -988,7 +988,7 @@ public class Float private () : Number, Comparable { * On the JVM, non-nullable values of this type are represented as values of the primitive type `double`. */ public class Double private () : Number, Comparable { - default object : FloatingPointConstants {} + class object Companion : FloatingPointConstants {} /** * Compares this value with the specified value for order. diff --git a/core/builtins/native/kotlin/String.kt b/core/builtins/native/kotlin/String.kt index c5309bffe4e..8a606ecd210 100644 --- a/core/builtins/native/kotlin/String.kt +++ b/core/builtins/native/kotlin/String.kt @@ -21,7 +21,7 @@ package kotlin * implemented as instances of this class. */ public class String : Comparable, CharSequence { - default object {} + class object Companion {} /** * Returns a string obtained by concatenating this string with the string representation of the given [other] object. diff --git a/core/builtins/src/kotlin/Ranges.kt b/core/builtins/src/kotlin/Ranges.kt index b6569ee97b9..f5d73be0d12 100644 --- a/core/builtins/src/kotlin/Ranges.kt +++ b/core/builtins/src/kotlin/Ranges.kt @@ -38,7 +38,7 @@ public class ByteRange(override val start: Byte, override val end: Byte) : Range override fun hashCode(): Int = if (isEmpty()) -1 else (31 * start.toInt() + end) - default object { + class object Companion { /** An empty range of values of type Byte. */ public val EMPTY: ByteRange = ByteRange(1, 0) } @@ -64,7 +64,7 @@ public class CharRange(override val start: Char, override val end: Char) : Range override fun hashCode(): Int = if (isEmpty()) -1 else (31 * start.toInt() + end) - default object { + class object Companion { /** An empty range of values of type Char. */ public val EMPTY: CharRange = CharRange(1.toChar(), 0.toChar()) } @@ -90,7 +90,7 @@ public class ShortRange(override val start: Short, override val end: Short) : Ra override fun hashCode(): Int = if (isEmpty()) -1 else (31 * start.toInt() + end) - default object { + class object Companion { /** An empty range of values of type Short. */ public val EMPTY: ShortRange = ShortRange(1, 0) } @@ -116,7 +116,7 @@ public class IntRange(override val start: Int, override val end: Int) : Range resolveSamAdapter(original: D) = null override fun resolveSamConstructor(name: Name, scope: JetScope) = null override fun resolveFunctionTypeIfSamInterface( diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/MemberSignature.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/MemberSignature.kt index ccaf1a8ad81..98402b0d574 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/MemberSignature.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin/MemberSignature.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.name.Name // The purpose of this class is to hold a unique signature of either a method or a field, so that annotations on a member can be put // into a map indexed by these signatures data class MemberSignature private(private val signature: String) { - default object { + class object { platformStatic public fun fromMethodNameAndDesc(nameAndDesc: String): MemberSignature { return MemberSignature(nameAndDesc) } diff --git a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaAnnotationArguments.kt b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaAnnotationArguments.kt index 313843bf22e..3425290445c 100644 --- a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaAnnotationArguments.kt +++ b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaAnnotationArguments.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.name.Name abstract class ReflectJavaAnnotationArgument( override val name: Name? ) : JavaAnnotationArgument { - default object Factory { + class object Factory { fun create(value: Any, name: Name?): ReflectJavaAnnotationArgument { return when { value.javaClass.isEnumClassOrSpecializedEnumEntryClass() -> ReflectJavaEnumValueAnnotationArgument(name, value as Enum<*>) diff --git a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaType.kt b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaType.kt index d133bc065c8..de71b7a5fca 100644 --- a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaType.kt +++ b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/java/structure/reflect/ReflectJavaType.kt @@ -27,7 +27,7 @@ public abstract class ReflectJavaType : JavaType { override fun createArrayType(): JavaArrayType = throw UnsupportedOperationException() - default object Factory { + class object Factory { fun create(type: Type): ReflectJavaType { return when { type is Class<*> && type.isPrimitive() -> ReflectJavaPrimitiveType(type) diff --git a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClass.kt b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClass.kt index 54bf35bf45e..83af46896b4 100644 --- a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClass.kt +++ b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClass.kt @@ -44,7 +44,7 @@ public class ReflectKotlinClass private( private val classHeader: KotlinClassHeader ) : KotlinJvmBinaryClass { - default object Factory { + class object Factory { public fun create(klass: Class<*>): ReflectKotlinClass? { val headerReader = ReadKotlinClassHeaderAnnotationVisitor() diff --git a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/RuntimeModuleData.kt b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/RuntimeModuleData.kt index bec84863f9e..911071839ce 100644 --- a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/RuntimeModuleData.kt +++ b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/RuntimeModuleData.kt @@ -29,7 +29,7 @@ public class RuntimeModuleData private(private val injector: InjectorForRuntimeD public val localClassResolver: LocalClassResolver get() = injector.getDeserializationComponentsForJava().components.localClassResolver - default object { + class object { public fun create(classLoader: ClassLoader): RuntimeModuleData { val module = ModuleDescriptorImpl(Name.special(""), listOf(), JavaToKotlinClassMap.INSTANCE) module.addDependencyOnModule(module) diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt index 088b0ede47f..66e92a84753 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt @@ -26,7 +26,7 @@ public trait Annotations : Iterable { public fun findAnnotation(fqName: FqName): AnnotationDescriptor? - default object { + class object { public val EMPTY: Annotations = object : Annotations { override fun isEmpty() = true diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/JetScope.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/JetScope.kt index 070f119d887..2aa6f5b011b 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/JetScope.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/JetScope.kt @@ -76,7 +76,7 @@ public trait JetScope { } } - default object { + class object { public val ALL_NAME_FILTER: (Name) -> Boolean = { true } } } @@ -141,7 +141,7 @@ public class DescriptorKindFilter( } } - default object { + class object { public val NON_SINGLETON_CLASSIFIERS_MASK: Int = 0x01 public val SINGLETON_CLASSIFIERS_MASK: Int = 0x02 public val PACKAGES_MASK: Int = 0x04 diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/flexibleTypes.kt b/core/descriptors/src/org/jetbrains/kotlin/types/flexibleTypes.kt index b98372f28ad..4e10c7c353b 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/flexibleTypes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/flexibleTypes.kt @@ -33,7 +33,7 @@ public trait FlexibleTypeCapabilities { } public trait Flexibility : TypeCapability, SubtypingRepresentatives { - default object { + class object { // This is a "magic" classifier: when type resolver sees it in the code, e.g. ft, instead of creating a normal type, // it creates a flexible type, e.g. (Foo..Foo?). // This is used in tests and Evaluate Expression to have flexible types in the code, @@ -145,7 +145,7 @@ public open class DelegatingFlexibleType protected ( override val upperBound: JetType, override val extraCapabilities: FlexibleTypeCapabilities ) : DelegatingType(), NullAwareness, Flexibility, FlexibleTypeDelegation, Approximation { - default object { + class object { platformStatic fun create(lowerBound: JetType, upperBound: JetType, extraCapabilities: FlexibleTypeCapabilities): JetType { if (lowerBound == upperBound) return lowerBound return DelegatingFlexibleType(lowerBound, upperBound, extraCapabilities) diff --git a/generators/src/org/jetbrains/kotlin/generators/builtins/common.kt b/generators/src/org/jetbrains/kotlin/generators/builtins/common.kt index 045d76f197d..9ddaa55085e 100644 --- a/generators/src/org/jetbrains/kotlin/generators/builtins/common.kt +++ b/generators/src/org/jetbrains/kotlin/generators/builtins/common.kt @@ -30,7 +30,7 @@ enum class PrimitiveType { BOOLEAN val capitalized: String get() = name().toLowerCase().capitalize() - default object { + class object { val exceptBoolean: Iterable by Delegates.lazy { PrimitiveType.values().filterNot { it == BOOLEAN } } } } diff --git a/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt b/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt index 1fe0bde5e76..77a005f477a 100644 --- a/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt +++ b/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt @@ -61,7 +61,7 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) { } out.println("Comparable<$className> {") - out.print(" default object") + out.print(" class object Companion") if (kind == PrimitiveType.FLOAT || kind == PrimitiveType.DOUBLE) { out.print(" : FloatingPointConstants<$className>") } diff --git a/generators/src/org/jetbrains/kotlin/generators/builtins/ranges.kt b/generators/src/org/jetbrains/kotlin/generators/builtins/ranges.kt index 2fcd23f3049..407b25b44f5 100644 --- a/generators/src/org/jetbrains/kotlin/generators/builtins/ranges.kt +++ b/generators/src/org/jetbrains/kotlin/generators/builtins/ranges.kt @@ -82,7 +82,7 @@ public class $range(override val start: $t, override val end: $t) : Range<$t>, P override fun hashCode(): Int $hashCode - default object { + class object Companion { /** An empty range of values of type $t. */ public val EMPTY: $range = $range($emptyBounds) } diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt index a48ffc3b78c..92a63aadcd9 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt @@ -48,7 +48,7 @@ public class ReferenceVariantsHelper( public val receivers: Collection, public val callType: CallType ) { - default object { + class object { val Empty = ReceiversData(listOf(), CallType.NORMAL) } } @@ -216,7 +216,7 @@ public class ReferenceVariantsHelper( return resolutionScope.getDescriptorsFiltered(DescriptorKindFilter.PACKAGES, nameFilter).filter(visibilityFilter) } - default object { + class object { public fun getExplicitReceiverData(expression: JetSimpleNameExpression): Pair? { val receiverExpression = expression.getReceiverExpression() ?: return null val parent = expression.getParent() diff --git a/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt b/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt index b6881939ed3..14896ff3136 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt @@ -469,7 +469,7 @@ class PartialBodyResolveFilter( NEED_COMPLETION } - default object { + class object { private fun JetElement.blocks(): Collection { val result = ArrayList(1) this.accept(object : JetVisitorVoid() { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt index 048c2de865a..dfb6c805f4b 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.idea.actions.internal import com.intellij.ide.util.PropertiesComponent public class KotlinInternalMode { - public default object Instance { + public class object Instance { val INTERNAL_MODE_PROPERTY = "kotlin.internal.mode.enabled" public var enabled: Boolean diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/JetShortNamesCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/JetShortNamesCache.kt index 73313740e0c..abe3bd07595 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/JetShortNamesCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/JetShortNamesCache.kt @@ -27,7 +27,7 @@ import org.jetbrains.kotlin.idea.stubindex.JetFunctionShortNameIndex // used in Upsource, what's why in idea-analysis module public class JetShortNamesCache(private val project: com.intellij.openapi.project.Project) : com.intellij.psi.search.PsiShortNamesCache() { - default object { + class object { public fun getKotlinInstance(project: com.intellij.openapi.project.Project): org.jetbrains.kotlin.idea.caches.JetShortNamesCache = com.intellij.openapi.extensions.Extensions.getArea(project).getExtensionPoint(com.intellij.psi.search.PsiShortNamesCache.EP_NAME).getExtensions() .firstIsInstance() diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheService.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheService.kt index a63f7625a59..898cc630a1e 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheService.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinCacheService.kt @@ -45,7 +45,7 @@ import kotlin.platform.platformStatic private val LOG = Logger.getInstance(javaClass()) public class KotlinCacheService(val project: Project) { - default object { + class object { platformStatic public fun getInstance(project: Project): KotlinCacheService = ServiceManager.getService(project, javaClass())!! } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryModificationTracker.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryModificationTracker.kt index 1532136080e..da5d259c204 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryModificationTracker.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/LibraryModificationTracker.kt @@ -31,7 +31,7 @@ import com.intellij.codeInsight.ExternalAnnotationsListener import com.intellij.psi.PsiModifierListOwner class LibraryModificationTracker(project: Project) : SimpleModificationTracker() { - default object { + class object { platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass())!! } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/globalContextUtils.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/globalContextUtils.kt index c9de31164e5..44f73ee1758 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/globalContextUtils.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/globalContextUtils.kt @@ -43,7 +43,7 @@ private class ExceptionTrackerWithProcessCanceledReport() : ExceptionTracker() { } - default object { + class object { val LOG = Logger.getInstance(javaClass()) } } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/ModuleTypeCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/ModuleTypeCache.kt index 27ab7fff12c..263b6a296a3 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/ModuleTypeCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/ModuleTypeCache.kt @@ -32,7 +32,7 @@ import com.intellij.openapi.util.SimpleModificationTracker import kotlin.platform.platformStatic class ModuleTypeCacheManager private (project: Project) { - default object { + class object { platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass()) } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/KotlinClsStubBuilder.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/KotlinClsStubBuilder.kt index 8d8feb83d89..fa8b85926f8 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/KotlinClsStubBuilder.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/KotlinClsStubBuilder.kt @@ -87,7 +87,7 @@ public class KotlinClsStubBuilder : ClsStubBuilder() { return ClsStubBuilderComponents(classDataFinder, annotationLoader) } - default object { + class object { val LOG = Logger.getInstance(javaClass()) } } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/DeserializerForDecompiler.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/DeserializerForDecompiler.kt index b79d25fd0f4..4397d443d21 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/DeserializerForDecompiler.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/DeserializerForDecompiler.kt @@ -113,7 +113,7 @@ public class DeserializerForDecompiler(val packageDirectory: VirtualFile, val di return MutablePackageFragmentDescriptor(moduleDescriptor, fqName) } - default object { + class object { private val LOG = Logger.getInstance(javaClass()) } } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt index 3f28ba7f38b..cdf7fbdddb3 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt @@ -222,7 +222,7 @@ public open class JetPsiChecker : Annotator, HighlightRangeExtension { } } - default object { + class object { var namesHighlightingEnabled = true [TestOnly] set diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/TypeKindHighlightingVisitor.java b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/TypeKindHighlightingVisitor.java index 255b9f3a542..70d3636198e 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/TypeKindHighlightingVisitor.java +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/TypeKindHighlightingVisitor.java @@ -34,7 +34,7 @@ class TypeKindHighlightingVisitor extends AfterAnalysisHighlightingVisitor { public void visitSimpleNameExpression(@NotNull JetSimpleNameExpression expression) { PsiReference ref = expression.getReference(); if (ref == null) return; - if (JetPsiChecker.Default.getNamesHighlightingEnabled()) { + if (JetPsiChecker.OBJECT$.getNamesHighlightingEnabled()) { DeclarationDescriptor referenceTarget = bindingContext.get(BindingContext.REFERENCE_TARGET, expression); if (referenceTarget instanceof ConstructorDescriptor) { referenceTarget = referenceTarget.getContainingDeclaration(); diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt index 807995aca26..91dac12e458 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt @@ -33,7 +33,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall import org.jetbrains.kotlin.idea.caches.resolve.analyze public class OperatorToFunctionIntention : JetSelfTargetingIntention("operator.to.function", javaClass()) { - default object { + class object { private fun isApplicablePrefix(element: JetPrefixExpression): Boolean { return when (element.getOperationReference().getReferencedNameElementType()) { JetTokens.PLUS, JetTokens.MINUS, JetTokens.PLUSPLUS, JetTokens.MINUSMINUS, JetTokens.EXCL -> true diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/JetForLoopInReference.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/JetForLoopInReference.kt index e5fa6ad58cb..e4af8106997 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/JetForLoopInReference.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/JetForLoopInReference.kt @@ -41,7 +41,7 @@ public class JetForLoopInReference(element: JetForExpression) : JetMultiReferenc return LOOP_RANGE_KEYS.map { key -> context.get(key, loopRange)?.getCandidateDescriptor() }.filterNotNull() } - default object { + class object { private val LOOP_RANGE_KEYS = array( BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL, BindingContext.LOOP_RANGE_NEXT_RESOLVED_CALL, diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/usagesSearch.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/usagesSearch.kt index fb0ba28cf9c..c3b2f2caded 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/usagesSearch.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/usagesSearch.kt @@ -57,7 +57,7 @@ public data class UsagesSearchLocation( val inStrings: Boolean = false, val inPlainText: Boolean = true ) { - default object { + class object { public val DEFAULT: UsagesSearchLocation = UsagesSearchLocation() public val EVERYWHERE: UsagesSearchLocation = UsagesSearchLocation(true, true, true, true) } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/SubpackagesIndexService.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/SubpackagesIndexService.kt index 894b8974ddb..7d3781d407f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/SubpackagesIndexService.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/SubpackagesIndexService.kt @@ -78,7 +78,7 @@ public class SubpackagesIndexService(private val project: Project) { } } - default object { + class object { public fun getInstance(project: Project): SubpackagesIndex { return ServiceManager.getService(project, javaClass())!!.cachedValue.getValue()!! } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ImportInsertHelper.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ImportInsertHelper.kt index c4b8cfbbd9e..7d0116175fc 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ImportInsertHelper.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ImportInsertHelper.kt @@ -44,7 +44,7 @@ public abstract class ImportInsertHelper { public abstract fun importDescriptor(file: JetFile, descriptor: DeclarationDescriptor): ImportDescriptorResult - default object { + class object { [platformStatic] public fun getInstance(project: Project): ImportInsertHelper = ServiceManager.getService(project, javaClass()) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ShortenReferences.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ShortenReferences.kt index 8272e40b65d..a2a63d9168a 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ShortenReferences.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/util/ShortenReferences.kt @@ -46,12 +46,12 @@ public class ShortenReferences(val options: (JetElement) -> Options = { Options. val removeThisLabels: Boolean = false, val removeThis: Boolean = false ) { - default object { + class object { val DEFAULT = Options() } } - default object { + class object { val DEFAULT = ShortenReferences() private fun DeclarationDescriptor.asString() diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/plugin/references/SimpleNameReferenceExtension.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/plugin/references/SimpleNameReferenceExtension.kt index f5bdee1f94c..595199cfd3b 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/plugin/references/SimpleNameReferenceExtension.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/plugin/references/SimpleNameReferenceExtension.kt @@ -22,7 +22,7 @@ import com.intellij.psi.PsiElement import org.jetbrains.kotlin.psi.JetPsiFactory public trait SimpleNameReferenceExtension { - default object { + class object { public val EP_NAME: ExtensionPointName = ExtensionPointName.create("org.jetbrains.kotlin.simpleNameReferenceExtension")!! } diff --git a/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt b/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt index 89f4275c450..f1b5b37929e 100644 --- a/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt +++ b/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt @@ -21,7 +21,7 @@ public class CompilerSettings { public var copyJsLibraryFiles: Boolean = true public var outputDirectoryForJsLibraryFiles: String = DEFAULT_OUTPUT_DIRECTORY - default object { + class object { private val DEFAULT_ADDITIONAL_ARGUMENTS = "-version" private val DEFAULT_OUTPUT_DIRECTORY = "lib" } diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/JetAddImportAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/JetAddImportAction.kt index ad3622c3684..b2f456b547b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/actions/JetAddImportAction.kt +++ b/idea/src/org/jetbrains/kotlin/idea/actions/JetAddImportAction.kt @@ -154,7 +154,7 @@ public class JetAddImportAction( JBPopupFactory.getInstance().createListPopup(getImportSelectionPopup()).showInBestPositionFor(editor) } - default object { + class object { protected fun addImport(element: PsiElement, project: Project, selectedVariant: Variant) { PsiDocumentManager.getInstance(project).commitAllDocuments() diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinReferenceTransferableData.kt b/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinReferenceTransferableData.kt index d5950db844e..1c8bf39859d 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinReferenceTransferableData.kt +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinReferenceTransferableData.kt @@ -73,7 +73,7 @@ public class KotlinReferenceData( } } - default object { + class object { public val dataFlavor: DataFlavor? by Delegates.lazy { try { DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + ";class=" + javaClass().getName(), "KotlinReferenceData") diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/DeclarationDescriptorLookupObject.kt b/idea/src/org/jetbrains/kotlin/idea/completion/DeclarationDescriptorLookupObject.kt index d8d547fea5f..c2e16abfa1a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/DeclarationDescriptorLookupObject.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/DeclarationDescriptorLookupObject.kt @@ -52,7 +52,7 @@ public class DeclarationDescriptorLookupObject( return descriptorsEqualWithSubstitution(descriptor, lookupObject.descriptor) } - default object { + class object { private val LOG = Logger.getInstance("#" + javaClass().getName()) } } diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/KotlinCompletionCharFilter.kt b/idea/src/org/jetbrains/kotlin/idea/completion/KotlinCompletionCharFilter.kt index 88bbad05ee7..958a5b3b062 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/KotlinCompletionCharFilter.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/KotlinCompletionCharFilter.kt @@ -29,7 +29,7 @@ import org.jetbrains.kotlin.lexer.JetTokens import org.jetbrains.kotlin.psi.JetFunctionLiteral public class KotlinCompletionCharFilter() : CharFilter() { - default object { + class object { public val ACCEPT_OPENING_BRACE: Key = Key("KotlinCompletionCharFilter.ACCEPT_OPENNING_BRACE") public val JUST_TYPING_PREFIX: Key = Key("KotlinCompletionCharFilter.JUST_TYPING_PREFIX") diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/LeafElementFilter.kt b/idea/src/org/jetbrains/kotlin/idea/completion/LeafElementFilter.kt index 596052ca374..fb55ed942d3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/LeafElementFilter.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/LeafElementFilter.kt @@ -30,7 +30,7 @@ public class LeafElementFilter(private val elementType: IElementType) : ElementF override fun isClassAcceptable(hintClass: Class<*>) = LEAF_CLASS_FILTER.isClassAcceptable(hintClass) - default object { + class object { private val LEAF_CLASS_FILTER = ClassFilter(javaClass()) } } diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/LookupElementFactory.kt b/idea/src/org/jetbrains/kotlin/idea/completion/LookupElementFactory.kt index eb782e8191c..9d9da8d25f6 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/LookupElementFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/LookupElementFactory.kt @@ -255,7 +255,7 @@ public class LookupElementFactory( } } - default object { + class object { public fun getDefaultInsertHandler(descriptor: DeclarationDescriptor): InsertHandler { return when (descriptor) { is FunctionDescriptor -> { diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/handlers/KotlinCallableInsertHandler.kt b/idea/src/org/jetbrains/kotlin/idea/completion/handlers/KotlinCallableInsertHandler.kt index 837a05880c1..c86ef9779dc 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/handlers/KotlinCallableInsertHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/handlers/KotlinCallableInsertHandler.kt @@ -217,7 +217,7 @@ public class KotlinFunctionInsertHandler(val caretPosition : CaretPosition, val return caretPosition == CaretPosition.IN_BRACKETS } - default object { + class object { public val NO_PARAMETERS_HANDLER: KotlinFunctionInsertHandler = KotlinFunctionInsertHandler(CaretPosition.AFTER_BRACKETS, null) public val WITH_PARAMETERS_HANDLER: KotlinFunctionInsertHandler = KotlinFunctionInsertHandler(CaretPosition.IN_BRACKETS, null) diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/handlers/WithTailInsertHandler.kt b/idea/src/org/jetbrains/kotlin/idea/completion/handlers/WithTailInsertHandler.kt index 41c952e7465..777d550e1ed 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/handlers/WithTailInsertHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/handlers/WithTailInsertHandler.kt @@ -85,7 +85,7 @@ class WithTailInsertHandler(val tailText: String, } } - default object { + class object { fun commaTail() = WithTailInsertHandler(",", spaceBefore = false, spaceAfter = true /*TODO: use code style option*/) fun rparenthTail() = WithTailInsertHandler(")", spaceBefore = false, spaceAfter = false) fun elseTail() = WithTailInsertHandler("else", spaceBefore = true, spaceAfter = true) diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletion.kt b/idea/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletion.kt index 474ad4d2544..738d9efeeb5 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletion.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletion.kt @@ -473,7 +473,7 @@ class SmartCompletion( } } - default object { + class object { public val OLD_ARGUMENTS_REPLACEMENT_OFFSET: OffsetKey = OffsetKey.create("nonFunctionReplacementOffset") public val MULTIPLE_ARGUMENTS_REPLACEMENT_OFFSET: OffsetKey = OffsetKey.create("multipleArgumentsReplacementOffset") diff --git a/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt b/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt index 9a8cccc3340..2b935755f51 100644 --- a/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt @@ -104,7 +104,7 @@ fun LookupElement.addTailAndNameSimilarity(matchedExpectedInfos: Collection(), "class: ConvertJavaCopyPastePostProcessor") } } diff --git a/idea/src/org/jetbrains/kotlin/idea/coverage/KotlinCoverageExtension.kt b/idea/src/org/jetbrains/kotlin/idea/coverage/KotlinCoverageExtension.kt index 5d063ff39cf..db17335db0f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/coverage/KotlinCoverageExtension.kt +++ b/idea/src/org/jetbrains/kotlin/idea/coverage/KotlinCoverageExtension.kt @@ -116,7 +116,7 @@ public class KotlinCoverageExtension(): JavaCoverageEngineExtension() { return false } - default object { + class object { private val LOG = Logger.getInstance(javaClass()) fun collectGeneratedClassQualifiedNames(outputRoot: VirtualFile?, file: JetFile): List? { diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/JetPositionManager.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/JetPositionManager.kt index 720d0768d92..1f1a28a720e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/JetPositionManager.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/JetPositionManager.kt @@ -273,7 +273,7 @@ public class JetPositionManager(private val myDebugProcess: DebugProcess) : Mult myTypeMappers.put(key, value) } - default object { + class object { public fun createTypeMapper(file: JetFile, moduleInfo: IdeaModuleInfo): JetTypeMapper { val project = file.getProject() val packageFacadeScope = moduleInfo.contentScope() diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerSettings.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerSettings.kt index 6f9a252a715..3c76c3a8839 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerSettings.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerSettings.kt @@ -34,7 +34,7 @@ public class KotlinDebuggerSettings : XDebuggerSettings( public var DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES: Boolean = true public var DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED: Boolean = false - default object { + class object { public fun getInstance(): KotlinDebuggerSettings { return XDebuggerUtil.getInstance()?.getDebuggerSettings(javaClass())!! } diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt index 97659e7d836..381ea8aab32 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinEditorTextProvider.kt @@ -42,7 +42,7 @@ class KotlinEditorTextProvider : EditorTextProvider { return Pair(expression, expressionRange) } - default object { + class object { fun getElementInfo(expr: JetExpression, f: (PsiElement) -> T): T { var expressionText = f(expr) diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt index daca5930d78..d1c004033d7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinCodeFragmentFactory.kt @@ -95,7 +95,7 @@ class KotlinCodeFragmentFactory: CodeFragmentFactory() { override fun getEvaluatorBuilder() = KotlinEvaluationBuilder - default object { + class object { fun getContextElement(elementAt: PsiElement?): PsiElement? { if (elementAt == null) return null diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionCache.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionCache.kt index 0a5f5c9ae49..a1a6d67830b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionCache.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionCache.kt @@ -40,7 +40,7 @@ class KotlinEvaluateExpressionCache(val project: Project) { MultiMap.create(), PsiModificationTracker.MODIFICATION_COUNT) }, false) - default object { + class object { private val LOG = Logger.getLogger(javaClass())!! fun getInstance(project: Project) = ServiceManager.getService(project, javaClass())!! diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt index 8d250d39f04..43935d351eb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt @@ -157,7 +157,7 @@ class KotlinEvaluator(val codeFragment: JetCodeFragment, return null } - default object { + class object { private fun extractAndCompile(codeFragment: JetCodeFragment, sourcePosition: SourcePosition, context: EvaluationContextImpl): CompiledDataDescriptor { codeFragment.checkForErrors() diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt index ca7cb1ef155..00211719ff8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinRuntimeTypeEvaluator.kt @@ -79,7 +79,7 @@ public abstract class KotlinRuntimeTypeEvaluator( throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.surrounded.expression.null")) } - default object { + class object { private fun getCastableRuntimeType(project: Project, value: Value): JetType? { val myValue = value.asValue() var psiClass = myValue.asmType.getClassDescriptor(project) diff --git a/idea/src/org/jetbrains/kotlin/idea/editor/KotlinEnterHandler.kt b/idea/src/org/jetbrains/kotlin/idea/editor/KotlinEnterHandler.kt index 36b82362e2f..f8909810a7f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/editor/KotlinEnterHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/editor/KotlinEnterHandler.kt @@ -36,7 +36,7 @@ import com.intellij.psi.tree.TokenSet import com.intellij.psi.PsiWhiteSpace public class KotlinEnterHandler: EnterHandlerDelegateAdapter() { - default object { + class object { private val LOG = Logger.getInstance(javaClass()) private val FORCE_INDENT_IN_LAMBDA_AFTER = TokenSet.create(JetTokens.ARROW, JetTokens.LBRACE) } diff --git a/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinListSelectioner.kt b/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinListSelectioner.kt index 9c57b7db249..58e2c2e9f70 100644 --- a/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinListSelectioner.kt +++ b/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinListSelectioner.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.lexer.JetTokens import com.intellij.codeInsight.editorActions.ExtendWordSelectionHandlerBase public class KotlinListSelectioner : ExtendWordSelectionHandlerBase() { - default object { + class object { fun canSelect(e: PsiElement) = e is JetParameterList || e is JetValueArgumentList || e is JetTypeParameterList || e is JetTypeArgumentList } diff --git a/idea/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt b/idea/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt index 09dfd4dcf44..4c3d1c4f527 100644 --- a/idea/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.idea.JetIcons import org.jetbrains.kotlin.idea.project.TargetPlatform public class KotlinTemplatesFactory : ProjectTemplatesFactory() { - default object { + class object { public val KOTLIN_GROUP_NAME: String = "Kotlin" } diff --git a/idea/src/org/jetbrains/kotlin/idea/highlighter/JetPsiCheckerAndHighlightingUpdater.java b/idea/src/org/jetbrains/kotlin/idea/highlighter/JetPsiCheckerAndHighlightingUpdater.java index 3b1daae1589..d2955b10fa8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/highlighter/JetPsiCheckerAndHighlightingUpdater.java +++ b/idea/src/org/jetbrains/kotlin/idea/highlighter/JetPsiCheckerAndHighlightingUpdater.java @@ -46,7 +46,7 @@ public class JetPsiCheckerAndHighlightingUpdater extends JetPsiChecker { PsiElement grandParent = parameter.getParent().getParent(); if (grandParent instanceof JetNamedFunction) { JetNamedFunction function = (JetNamedFunction) grandParent; - return UnusedSymbolInspection.Default.isEntryPoint(function); + return UnusedSymbolInspection.OBJECT$.isEntryPoint(function); } return false; } diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt index bd7f5d73423..c83b3452662 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt @@ -53,7 +53,7 @@ import javax.swing.JComponent import javax.swing.JPanel public class UnusedSymbolInspection : AbstractKotlinInspection() { - default object { + class object { private val javaInspection = UnusedDeclarationInspection() public fun isEntryPoint(declaration: JetNamedDeclaration): Boolean { diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertFunctionToPropertyIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertFunctionToPropertyIntention.kt index 0c7d9c4a790..8cbae453018 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertFunctionToPropertyIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertFunctionToPropertyIntention.kt @@ -64,7 +64,7 @@ import org.jetbrains.kotlin.idea.util.ShortenReferences public class ConvertFunctionToPropertyIntention : JetSelfTargetingIntention( "convert.function.to.property.intention", javaClass() ) { - default object { + class object { private var JetNamedFunction.typeFqNameToAdd: String? by UserDataProperty(Key.create("TYPE_FQ_NAME_TO_ADD")) } diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertToBlockBodyAction.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertToBlockBodyAction.kt index dbeb44d1894..b100e5bb86d 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertToBlockBodyAction.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertToBlockBodyAction.kt @@ -37,7 +37,7 @@ public class ConvertToBlockBodyAction : PsiElementBaseIntentionAction() { convert(findDeclaration(element)!!) } - default object { + class object { fun convert(declaration: JetDeclarationWithBody): JetDeclarationWithBody { val body = declaration.getBodyExpression()!! diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArguments.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArguments.kt index f9df1a05490..b2180a220c2 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArguments.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArguments.kt @@ -59,7 +59,7 @@ public class InsertExplicitTypeArguments : JetSelfTargetingIntention( "remove.unnecessary.curly.brackets.from.string.template", javaClass()) { - default object { + class object { val INSTANCE = RemoveCurlyBracesFromTemplateIntention() val pattern = Pattern.compile("[a-zA-Z0-9_].*") } diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceItWithExplicitFunctionLiteralParamIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceItWithExplicitFunctionLiteralParamIntention.kt index aff18cf42f9..642e0f47a1b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceItWithExplicitFunctionLiteralParamIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ReplaceItWithExplicitFunctionLiteralParamIntention.kt @@ -68,7 +68,7 @@ public class ReplaceItWithExplicitFunctionLiteralParamIntention() : PsiElementBa return JetBundle.message("replace.it.with.explicit.function.literal.param.family") } - default object { + class object { fun isAutoCreatedIt(simpleNameExpression: JetSimpleNameExpression): Boolean { if (simpleNameExpression.getReferencedName() != "it") { return false diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/SwapBinaryExpression.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/SwapBinaryExpression.kt index 68947b92aa4..05c19d773f7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/SwapBinaryExpression.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/SwapBinaryExpression.kt @@ -27,7 +27,7 @@ import org.jetbrains.kotlin.types.expressions.OperatorConventions public class SwapBinaryExpression : JetSelfTargetingIntention( "swap.binary.expression", javaClass() ) { - default object { + class object { val SUPPORTED_OPERATIONS = setOf(PLUS, MUL, OROR, ANDAND, EQEQ, EXCLEQ, EQEQEQ, EXCLEQEQEQ, GT, LT, GTEQ, LTEQ) val SUPPORTED_OPERATION_NAMES = SUPPORTED_OPERATIONS.map { OperatorConventions.BINARY_OPERATION_NAMES[it]?.asString() }.toSet().filterNotNull() + diff --git a/idea/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt b/idea/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt index 83380cffe9b..43a9e1f08a2 100644 --- a/idea/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt +++ b/idea/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt @@ -40,7 +40,7 @@ import com.intellij.util.WaitForProgressToShow import com.intellij.openapi.application.ApplicationManager public class CreateIncrementalCompilationBackup: AnAction("Create backup for debugging Kotlin incremental compilation") { - default object { + class object { val BACKUP_DIR_NAME = ".backup" val PATCHES_TO_CREATE = 5 diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/AutoImportFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/AutoImportFix.kt index dc2de915eab..dc6123198f3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/AutoImportFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/AutoImportFix.kt @@ -164,7 +164,7 @@ public class AutoImportFix(element: JetSimpleNameExpression) : JetHintAction) { assert(outputValues.size() <= 3, "At most 3 output values are supported") } - default object { + class object { private val selectors = array("first", "second", "third") } @@ -330,7 +330,7 @@ enum class ExtractionTarget(val name: String) { abstract fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean - default object { + class object { fun checkNotTrait(descriptor: ExtractableCodeDescriptor): Boolean { val parent = descriptor.extractionData.targetSibling.getStrictParentOfType() return !(parent is JetClass && parent.isTrait()) @@ -367,7 +367,7 @@ data class ExtractionGeneratorOptions( val allowDummyName: Boolean = false, val allowExpressionBody: Boolean = true ) { - default object { + class object { val DEFAULT = ExtractionGeneratorOptions() } } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionData.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionData.kt index 243e323cbf3..6a8abf49abf 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionData.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionData.kt @@ -49,7 +49,7 @@ data class ExtractionOptions( val extractAsProperty: Boolean = false, val allowSpecialClassNames: Boolean = false ) { - default object { + class object { val DEFAULT = ExtractionOptions() } } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionEngine.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionEngine.kt index 593d4c63c9d..c137aaa474c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionEngine.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractionEngine.kt @@ -50,7 +50,7 @@ public open class ExtractionEngineHelper { continuation(ExtractionGeneratorConfiguration(descriptorWithConflicts.descriptor, ExtractionGeneratorOptions.DEFAULT)) } - default object { + class object { public val DEFAULT: ExtractionEngineHelper = ExtractionEngineHelper() } } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java index eed475221bb..6db92b0bd44 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java @@ -263,7 +263,7 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase { final JetExpression originalBody = originalDeclaration.getBodyExpression(); assert originalBody != null : "Original body is not found: " + originalDeclaration; - JetDeclarationWithBody newDeclaration = ConvertToBlockBodyAction.Default.convert(originalDeclaration); + JetDeclarationWithBody newDeclaration = ConvertToBlockBodyAction.OBJECT$.convert(originalDeclaration); JetBlockExpression newCommonContainer = (JetBlockExpression) newDeclaration.getBodyExpression(); assert newCommonContainer != null : "New body is not found: " + newDeclaration; diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/move/moveTopLevelDeclarations/MoveKotlinTopLevelDeclarationsProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/move/moveTopLevelDeclarations/MoveKotlinTopLevelDeclarationsProcessor.kt index ffdab1e4e7e..32ad133f687 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/move/moveTopLevelDeclarations/MoveKotlinTopLevelDeclarationsProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/move/moveTopLevelDeclarations/MoveKotlinTopLevelDeclarationsProcessor.kt @@ -96,7 +96,7 @@ public class MoveKotlinTopLevelDeclarationsProcessor( val project: Project, val options: MoveKotlinTopLevelDeclarationsOptions, val mover: Mover = Mover.Default) : BaseRefactoringProcessor(project) { - default object { + class object { private val LOG: Logger = Logger.getInstance(javaClass()) private val REFACTORING_NAME: String = JetRefactoringBundle.message("refactoring.move.top.level.declarations") diff --git a/idea/src/org/jetbrains/kotlin/idea/util/psi/patternMatching/JetPsiUnifier.kt b/idea/src/org/jetbrains/kotlin/idea/util/psi/patternMatching/JetPsiUnifier.kt index d02323e73c5..0e16e6e7f48 100644 --- a/idea/src/org/jetbrains/kotlin/idea/util/psi/patternMatching/JetPsiUnifier.kt +++ b/idea/src/org/jetbrains/kotlin/idea/util/psi/patternMatching/JetPsiUnifier.kt @@ -132,7 +132,7 @@ public class JetPsiUnifier( parameters: Collection = Collections.emptySet(), val allowWeakMatches: Boolean = false ) { - default object { + class object { val DEFAULT = JetPsiUnifier() } diff --git a/idea/src/org/jetbrains/kotlin/plugin/findUsages/handlers/KotlinFindUsagesHandlerDecorator.kt b/idea/src/org/jetbrains/kotlin/plugin/findUsages/handlers/KotlinFindUsagesHandlerDecorator.kt index 1fa256326f7..babfc90e9f6 100644 --- a/idea/src/org/jetbrains/kotlin/plugin/findUsages/handlers/KotlinFindUsagesHandlerDecorator.kt +++ b/idea/src/org/jetbrains/kotlin/plugin/findUsages/handlers/KotlinFindUsagesHandlerDecorator.kt @@ -21,7 +21,7 @@ import com.intellij.psi.PsiElement import com.intellij.find.findUsages.FindUsagesHandler public trait KotlinFindUsagesHandlerDecorator { - default object { + class object { public val EP_NAME: ExtensionPointName = ExtensionPointName.create("org.jetbrains.kotlin.findUsagesHandlerDecorator")!! } diff --git a/idea/tests/org/jetbrains/kotlin/checkers/AbstractJetPsiCheckerTest.java b/idea/tests/org/jetbrains/kotlin/checkers/AbstractJetPsiCheckerTest.java index b1848904674..204faa3584f 100644 --- a/idea/tests/org/jetbrains/kotlin/checkers/AbstractJetPsiCheckerTest.java +++ b/idea/tests/org/jetbrains/kotlin/checkers/AbstractJetPsiCheckerTest.java @@ -38,11 +38,11 @@ public abstract class AbstractJetPsiCheckerTest extends JetLightCodeInsightFixtu //noinspection unchecked myFixture.enableInspections(SpellCheckingInspection.class); - JetPsiChecker.Default.setNamesHighlightingEnabled(false); + JetPsiChecker.OBJECT$.setNamesHighlightingEnabled(false); checkHighlighting(true, true, false); } finally { - JetPsiChecker.Default.setNamesHighlightingEnabled(true); + JetPsiChecker.OBJECT$.setNamesHighlightingEnabled(true); } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/resolve/AbstractReferenceResolveInLibrarySourcesTest.kt b/idea/tests/org/jetbrains/kotlin/idea/resolve/AbstractReferenceResolveInLibrarySourcesTest.kt index 73fecd8c699..da3c1b209ac 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/resolve/AbstractReferenceResolveInLibrarySourcesTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/resolve/AbstractReferenceResolveInLibrarySourcesTest.kt @@ -25,7 +25,7 @@ import org.junit.Assert import junit.framework.AssertionFailedError public abstract class AbstractReferenceResolveInLibrarySourcesTest : JetLightCodeInsightFixtureTestCase() { - default object { + class object { private val REF_CARET_MARKER = "" } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt b/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt index b81af402f0e..3a875baa355 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt @@ -57,7 +57,7 @@ class Converter private( public val specialContext: PsiElement? = personalState.specialContext - default object { + class object { public fun create(elementToConvert: PsiElement, settings: ConverterSettings, conversionScope: ConversionScope, referenceSearcher: ReferenceSearcher, resolverForConverter: ResolverForConverter, postProcessor: PostProcessor?, usageProcessingsCollector: (UsageProcessing) -> Unit): Converter { diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ConverterSettings.kt b/j2k/src/org/jetbrains/kotlin/j2k/ConverterSettings.kt index 4e3ce8824bc..5e1071fe213 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ConverterSettings.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ConverterSettings.kt @@ -23,7 +23,7 @@ public data class ConverterSettings( var openByDefault: Boolean ) { - default object { + class object { public val defaultSettings: ConverterSettings = ConverterSettings( forceNotNullTypes = true, specifyLocalVariableTypeByDefault = false, diff --git a/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt b/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt index 653f5712d33..cf3b5a1faf5 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt @@ -94,7 +94,7 @@ object DocCommentConverter { private class HtmlToMarkdownConverter() : XmlRecursiveElementVisitor() { private enum class ListType { Ordered; Unordered } data class MarkdownSpan(val prefix: String, val suffix: String) { - default object { + class object { val Empty = MarkdownSpan("", "") fun wrap(text: String) = MarkdownSpan(text, text) diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ExpressionConverter.kt b/j2k/src/org/jetbrains/kotlin/j2k/ExpressionConverter.kt index 147010e032a..704b369a229 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ExpressionConverter.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ExpressionConverter.kt @@ -499,7 +499,7 @@ class DefaultExpressionConverter : JavaElementVisitor(), ExpressionConverter { return "" } - default object { + class object { private val needQualifierNameSet = setOf("java.lang.Byte", "java.lang.Double", "java.lang.Float", "java.lang.Long", "java.lang.Short") } } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/TypeConverter.kt b/j2k/src/org/jetbrains/kotlin/j2k/TypeConverter.kt index ace0b52d77c..81616c7fd7f 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/TypeConverter.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/TypeConverter.kt @@ -410,7 +410,7 @@ class TypeConverter(val converter: Converter) { } } - default object { + class object { private val boxingTypes: Set = setOf( CommonClassNames.JAVA_LANG_BYTE, CommonClassNames.JAVA_LANG_CHARACTER, diff --git a/j2k/src/org/jetbrains/kotlin/j2k/TypeVisitor.kt b/j2k/src/org/jetbrains/kotlin/j2k/TypeVisitor.kt index 509184c1a34..bd336a26358 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/TypeVisitor.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/TypeVisitor.kt @@ -115,7 +115,7 @@ class TypeVisitor( return VarArgType(typeConverter.convertType(ellipsisType.getComponentType())) } - default object { + class object { private val toKotlinTypesMap: Map = mapOf( CommonClassNames.JAVA_LANG_OBJECT to "kotlin.Any", CommonClassNames.JAVA_LANG_BYTE to "kotlin.Byte", diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/Annotation.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/Annotation.kt index cb60142c430..a932e537ec0 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/Annotation.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/Annotation.kt @@ -64,7 +64,7 @@ class Annotations(val annotations: List) : Element() { fun plus(other: Annotations) = Annotations(annotations + other.annotations).assignNoPrototype() - default object { + class object { val Empty = Annotations(listOf()) } } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/Block.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/Block.kt index 38b8fe26344..6eda4e4277f 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/Block.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/Block.kt @@ -31,7 +31,7 @@ class Block(val statements: List, val lBrace: LBrace, val rBrace: RBr builder.append(lBrace).append(statements, "\n", "\n", "\n").append(rBrace) } - default object { + class object { val Empty = Block(listOf(), LBrace(), RBrace()) } } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/Element.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/Element.kt index a63c9291e37..433f5e2cc4e 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/Element.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/Element.kt @@ -88,7 +88,7 @@ abstract class Element { override val isEmpty: Boolean get() = true } - default object { + class object { var saveCreationStacktraces = false } } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/Identifier.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/Identifier.kt index fcfa3894d4f..d3ed47069b6 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/Identifier.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/Identifier.kt @@ -51,7 +51,7 @@ class Identifier( override fun toString() = if (isNullable) "$name?" else name - default object { + class object { val Empty = Identifier("") private val KEYWORDS = JetTokens.KEYWORDS.getTypes().map { (it as JetKeywordToken).getValue() }.toSet() diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/MethodCallExpression.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/MethodCallExpression.kt index b2b5f664e95..b57bffbafad 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/MethodCallExpression.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/MethodCallExpression.kt @@ -36,7 +36,7 @@ class MethodCallExpression( } } - default object { + class object { public fun buildNotNull(receiver: Expression?, methodName: String, arguments: List = listOf(), diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/Modifier.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/Modifier.kt index bbc26bb797a..16ce9361a57 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/Modifier.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/Modifier.kt @@ -59,7 +59,7 @@ class Modifiers(modifiers: Collection) : Element() { fun accessModifier(): Modifier? = modifiers.firstOrNull { it in ACCESS_MODIFIERS } - default object { + class object { val Empty = Modifiers(listOf()) } } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/TypeParameters.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/TypeParameters.kt index d254ff5257b..d7ee697bc9d 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/TypeParameters.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/TypeParameters.kt @@ -54,7 +54,7 @@ class TypeParameterList(val parameters: List) : Element() { private fun hasWhere(): Boolean = parameters.any { it.hasWhere() } - default object { + class object { val Empty = TypeParameterList(listOf()) } } diff --git a/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt b/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt index fcd05b867a6..6266658a7fa 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt +++ b/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt @@ -70,7 +70,7 @@ import org.jetbrains.kotlin.utils.sure import org.jetbrains.kotlin.jps.build.KotlinJpsCompilerArgumentsProvider public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) { - default object { + class object { public val KOTLIN_BUILDER_NAME: String = "Kotlin Builder" private val LOG = Logger.getInstance("#org.jetbrains.jps.cmdline.BuildSession") diff --git a/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt b/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt index 123058f6aa5..953d3f8a2a4 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt +++ b/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt @@ -55,7 +55,7 @@ private val CACHE_DIRECTORY_NAME = "kotlin" class CacheFormatVersion(targetDataRoot: File) { - default object { + class object { // Change this when incremental cache format changes private val INCREMENTAL_CACHE_OWN_VERSION = 2 private val CACHE_FORMAT_VERSION: Int = INCREMENTAL_CACHE_OWN_VERSION * 1000000 + JvmAbi.VERSION @@ -82,7 +82,7 @@ class CacheFormatVersion(targetDataRoot: File) { } public class IncrementalCacheImpl(targetDataRoot: File) : StorageOwner, IncrementalCache { - default object { + class object { val PROTO_MAP = "proto.tab" val CONSTANTS_MAP = "constants.tab" val INLINE_FUNCTIONS = "inline-functions.tab" diff --git a/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LocalFileKotlinClass.kt b/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LocalFileKotlinClass.kt index e57a8a934d1..9b27dc8647e 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LocalFileKotlinClass.kt +++ b/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/LocalFileKotlinClass.kt @@ -29,7 +29,7 @@ class LocalFileKotlinClass private( innerClasses: FileBasedKotlinClass.InnerClassesInfo ) : FileBasedKotlinClass(className, classHeader, innerClasses) { - default object { + class object { fun create(file: File): LocalFileKotlinClass? { val fileContents = file.readBytes() return FileBasedKotlinClass.create(fileContents) { diff --git a/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJpsTest.kt b/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJpsTest.kt index f9620793a9a..61f75320692 100644 --- a/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJpsTest.kt +++ b/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJpsTest.kt @@ -51,7 +51,7 @@ import org.jetbrains.jps.api.CanceledStatus import org.jetbrains.jps.builders.java.dependencyView.Callbacks public abstract class AbstractIncrementalJpsTest : JpsBuildTestCase() { - default object { + class object { val COMPILATION_FAILED = "COMPILATION FAILED" // change to "/tmp" or anything when default is too long (for easier debugging) diff --git a/jps-plugin/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt b/jps-plugin/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt index 495ade9943c..7652295c2f9 100644 --- a/jps-plugin/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt +++ b/jps-plugin/test/org/jetbrains/kotlin/jvm/compiler/ClasspathOrderTest.kt @@ -29,7 +29,7 @@ import org.jetbrains.kotlin.utils.PathUtil * with a "newer" version in sources, and check that this class resolves to the one from sources by calling a method absent in the runtime */ public class ClasspathOrderTest : TestCaseWithTmpdir() { - default object { + class object { val sourceDir = File(JetTestUtils.getTestDataPathBase() + "/classpathOrder").getAbsoluteFile() } diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/jsScopes.kt b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/jsScopes.kt index f407e8a4342..59cd3ccec16 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/jsScopes.kt +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/jsScopes.kt @@ -80,7 +80,7 @@ public class JsFunctionScope(parent: JsScope, description: String) : JsScope(par || getParent()?.hasOwnName(name) ?: false } - default object { + class object { public val RESERVED_WORDS: Set = setOf( // keywords "await", "break", "case", "catch", "continue", "debugger", "default", "delete", "do", "else", "finally", "for", "function", "if", diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/PredefinedAnnotation.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/PredefinedAnnotation.kt index 0252530f8fa..0294226b61c 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/PredefinedAnnotation.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/PredefinedAnnotation.kt @@ -28,7 +28,7 @@ public enum class PredefinedAnnotation(fqName: String) { public val fqName: FqName = FqName(fqName) - default object { + class object { // TODO: replace with straight assignment when KT-5761 will be fixed val WITH_CUSTOM_NAME by Delegates.lazy { setOf(LIBRARY, NATIVE) } } diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/analyzer/JsAnalysisResult.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/analyzer/JsAnalysisResult.kt index dce697c5517..bd97068d04c 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/analyzer/JsAnalysisResult.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/analyzer/JsAnalysisResult.kt @@ -28,7 +28,7 @@ public class JsAnalysisResult( moduleDescriptor: ModuleDescriptor ) : AnalysisResult(bindingTrace.getBindingContext(), moduleDescriptor) { - default object { + class object { platformStatic public fun success(trace: BindingTrace, module: ModuleDescriptor): JsAnalysisResult { return JsAnalysisResult(trace, module) } diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsCallChecker.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsCallChecker.kt index d2d198707da..3cfc0adce75 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsCallChecker.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/JsCallChecker.kt @@ -50,7 +50,7 @@ import org.jetbrains.kotlin.resolve.TemporaryBindingTrace public class JsCallChecker : CallChecker { - default object { + class object { private val JS_PATTERN: DescriptorPredicate = PatternBuilder.pattern("kotlin.js.js(String)") platformStatic diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/translate/utils/AnnotationsUtils.java b/js/js.frontend/src/org/jetbrains/kotlin/js/translate/utils/AnnotationsUtils.java index 439d7e28b21..2c4b8d5c07a 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/translate/utils/AnnotationsUtils.java +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/translate/utils/AnnotationsUtils.java @@ -94,7 +94,7 @@ public final class AnnotationsUtils { } for (DeclarationDescriptor descriptor : descriptors) { - for (PredefinedAnnotation annotation : PredefinedAnnotation.Default.getWITH_CUSTOM_NAME()) { + for (PredefinedAnnotation annotation : PredefinedAnnotation.OBJECT$.getWITH_CUSTOM_NAME()) { if (!hasAnnotationOrInsideAnnotatedClass(descriptor, annotation)) { continue; } diff --git a/js/js.libraries/src/core/dom.kt b/js/js.libraries/src/core/dom.kt index 745015ba126..87f5e3ea25a 100644 --- a/js/js.libraries/src/core/dom.kt +++ b/js/js.libraries/src/core/dom.kt @@ -93,7 +93,7 @@ native public trait DOMError { public val severity: Short public val type: String - public default object { + public class object { public val SEVERITY_ERROR: Short = 2 public val SEVERITY_FATAL_ERROR: Short = 3 public val SEVERITY_WARNING: Short = 1 @@ -221,7 +221,7 @@ native public trait Node { public fun replaceChild(arg1: Node, arg2: Node): Node = noImpl public fun setUserData(arg1: String?, arg2: Any, arg3: UserDataHandler): Any = noImpl - public default object { + public class object { public val ATTRIBUTE_NODE: Short = 2 public val CDATA_SECTION_NODE: Short = 4 public val COMMENT_NODE: Short = 8 @@ -270,7 +270,7 @@ native public trait TypeInfo { public val typeNamespace: String public fun isDerivedFrom(arg1: String?, arg2: String?, arg3: Int): Boolean = noImpl - public default object { + public class object { public val DERIVATION_EXTENSION: Int = 2 public val DERIVATION_LIST: Int = 8 public val DERIVATION_RESTRICTION: Int = 1 @@ -281,7 +281,7 @@ native public trait TypeInfo { native public trait UserDataHandler { public fun handle(arg1: Short, arg2: String?, arg3: Any, arg4: Node, arg5: Node): Unit = noImpl - public default object { + public class object { public val NODE_ADOPTED: Short = 5 public val NODE_CLONED: Short = 1 public val NODE_DELETED: Short = 3 diff --git a/js/js.libraries/src/core/domEvents.kt b/js/js.libraries/src/core/domEvents.kt index 18285dfb5cc..7c766d78021 100644 --- a/js/js.libraries/src/core/domEvents.kt +++ b/js/js.libraries/src/core/domEvents.kt @@ -29,7 +29,7 @@ native public trait Event { public fun preventDefault(): Unit = noImpl public fun stopPropagation(): Unit = noImpl - public default object { + public class object { public val AT_TARGET: Short = 2 public val BUBBLING_PHASE: Short = 3 public val CAPTURING_PHASE: Short = 1 @@ -64,7 +64,7 @@ native public trait MutationEvent: Event { public val relatedNode: Node public fun initMutationEvent(arg1: String?, arg2: Boolean, arg3: Boolean, arg4: Node, arg5: String?, arg6: String?, arg7: String?, arg8: Short): Unit = noImpl - public default object { + public class object { public val ADDITION: Short = 2 public val MODIFICATION: Short = 1 public val REMOVAL: Short = 3 diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/InlineMetadata.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/InlineMetadata.kt index 94ec36cbbc8..ccf15875156 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/InlineMetadata.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/InlineMetadata.kt @@ -31,7 +31,7 @@ public class InlineMetadata( val function: JsFunction, val endTag: JsStringLiteral ) { - default object { + class object { platformStatic fun compose(function: JsFunction, descriptor: CallableDescriptor): InlineMetadata { val program = function.getScope().getProgram() diff --git a/libraries/sandbox/templatelib/src/TemplateHtml.kt b/libraries/sandbox/templatelib/src/TemplateHtml.kt index 52c63590115..a6cdbb0ac03 100644 --- a/libraries/sandbox/templatelib/src/TemplateHtml.kt +++ b/libraries/sandbox/templatelib/src/TemplateHtml.kt @@ -28,12 +28,12 @@ abstract class Tag(val name : String) : Element() { val attributes = HashMap() protected fun initTag(init : T.()-> Unit) : T - where default object T : Factory { + where class object T : Factory { val tag = try { T.create() } catch (e: NullPointerException) { val typeName = javaClass.getName() - throw UnsupportedOperationException("No default object create() method for $typeName") + throw UnsupportedOperationException("No class object create() method for $typeName") } tag.init() children.add(tag) @@ -76,7 +76,7 @@ abstract class TagWithText(name : String) : Tag(name) { } class HTML() : TagWithText("html") { - default object : Factory { + class object : Factory { override fun create() = HTML() } @@ -86,7 +86,7 @@ class HTML() : TagWithText("html") { } class Head() : TagWithText("head") { - default object : Factory { + class object : Factory { override fun create() = Head() } @@ -94,7 +94,7 @@ class Head() : TagWithText("head") { } class Title() : TagWithText("title") { - default object : Factory { + class object : Factory<Title> { override fun create() = Title() } } @@ -103,7 +103,7 @@ abstract class BodyTag(name : String) : TagWithText(name) { } class Body() : BodyTag("body") { - default object : Factory<Body> { + class object : Factory<Body> { override fun create() = Body() } @@ -122,24 +122,24 @@ class Body() : BodyTag("body") { } class B() : BodyTag("b") { - default object : Factory<B> { + class object : Factory<B> { override fun create() = B() } } class P() : BodyTag("p") { - default object : Factory<P> { + class object : Factory<P> { override fun create() = P() } } class H1() : BodyTag("h1") { - default object : Factory<H1> { + class object : Factory<H1> { override fun create() = H1() } } class A() : BodyTag("a") { - default object : Factory<A> { + class object : Factory<A> { override fun create() = A() } diff --git a/libraries/sandbox/templatelib/test/TemplateHtmlTest.kt b/libraries/sandbox/templatelib/test/TemplateHtmlTest.kt index c47b1c21cb5..71812b88ba5 100644 --- a/libraries/sandbox/templatelib/test/TemplateHtmlTest.kt +++ b/libraries/sandbox/templatelib/test/TemplateHtmlTest.kt @@ -42,7 +42,7 @@ html { } } -/** Create a bad element which doesn't have a default object create() method */ +/** Create a bad element which doesn't have a class object create() method */ class BadElem() : BodyTag("bad") { } diff --git a/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt b/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt index 172c8b877f1..3f5f969aa81 100644 --- a/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt +++ b/libraries/stdlib/src/kotlin/concurrent/FunctionalList.kt @@ -48,7 +48,7 @@ public abstract class FunctionalList<T>(public val size: Int) { private class Standard<T>(override val head: T, override val tail: FunctionalList<T>) : FunctionalList<T>(tail.size + 1) - default object { + class object { public fun <T> emptyList(): FunctionalList<T> = Empty<T>() public fun <T> of(element: T): FunctionalList<T> = FunctionalList.Standard<T>(element, emptyList()) diff --git a/libraries/stdlib/src/kotlin/jvm/BuiltinExtensions.kt b/libraries/stdlib/src/kotlin/jvm/BuiltinExtensions.kt index a73f40eec4e..b501672d205 100644 --- a/libraries/stdlib/src/kotlin/jvm/BuiltinExtensions.kt +++ b/libraries/stdlib/src/kotlin/jvm/BuiltinExtensions.kt @@ -18,53 +18,53 @@ package kotlin.jvm /** * A constant holding the minimum value an `Int` can have, -2^31. */ -public val Int.Default.MIN_VALUE: Int get() = java.lang.Integer.MIN_VALUE +public val Int.Companion.MIN_VALUE: Int get() = java.lang.Integer.MIN_VALUE /** * A constant holding the maximum value an `Int` can have, 2^31-1. */ -public val Int.Default.MAX_VALUE: Int get() = java.lang.Integer.MAX_VALUE +public val Int.Companion.MAX_VALUE: Int get() = java.lang.Integer.MAX_VALUE /** * A constant holding the smallest positive nonzero value of type `Double`, 2^-1074. */ -public val Double.Default.MIN_VALUE: Double get() = java.lang.Double.MIN_VALUE +public val Double.Companion.MIN_VALUE: Double get() = java.lang.Double.MIN_VALUE /** * A constant holding the largest positive finite value of type `Double`, (2-2^-52)*2^1023. */ -public val Double.Default.MAX_VALUE: Double get() = java.lang.Double.MAX_VALUE +public val Double.Companion.MAX_VALUE: Double get() = java.lang.Double.MAX_VALUE /** * A constant holding the smallest positive nonzero value of type `Float`, 2^-149. */ -public val Float.Default.MIN_VALUE: Float get() = java.lang.Float.MIN_VALUE +public val Float.Companion.MIN_VALUE: Float get() = java.lang.Float.MIN_VALUE /** * * A constant holding the largest positive finite value of type `Float`, (2-2^-23)*2^127. */ -public val Float.Default.MAX_VALUE: Float get() = java.lang.Float.MAX_VALUE +public val Float.Companion.MAX_VALUE: Float get() = java.lang.Float.MAX_VALUE /** * A constant holding the minimum value a `Long` can have, -2^63. */ -public val Long.Default.MIN_VALUE: Long get() = java.lang.Long.MIN_VALUE +public val Long.Companion.MIN_VALUE: Long get() = java.lang.Long.MIN_VALUE /** * A constant holding the maximum value a `Long` can have, 2^63-1. */ -public val Long.Default.MAX_VALUE: Long get() = java.lang.Long.MAX_VALUE +public val Long.Companion.MAX_VALUE: Long get() = java.lang.Long.MAX_VALUE /** * A constant holding the minimum value a `Short` can have, -2^15. */ -public val Short.Default.MIN_VALUE: Short get() = java.lang.Short.MIN_VALUE +public val Short.Companion.MIN_VALUE: Short get() = java.lang.Short.MIN_VALUE /** * A constant holding the maximum value a `Short` can have, 2^15-1. */ -public val Short.Default.MAX_VALUE: Short get() = java.lang.Short.MAX_VALUE +public val Short.Companion.MAX_VALUE: Short get() = java.lang.Short.MAX_VALUE /** * A constant holding the minimum value a `Byte` can have, -128. */ -public val Byte.Default.MIN_VALUE: Byte get() = java.lang.Byte.MIN_VALUE +public val Byte.Companion.MIN_VALUE: Byte get() = java.lang.Byte.MIN_VALUE /** * A constant holding the maximum value a `Byte` can have, 127. */ -public val Byte.Default.MAX_VALUE: Byte get() = java.lang.Byte.MAX_VALUE \ No newline at end of file +public val Byte.Companion.MAX_VALUE: Byte get() = java.lang.Byte.MAX_VALUE \ No newline at end of file diff --git a/libraries/tools/kotlin-js-tests-junit/src/test/kotlin/tests/SeleniumTestSuite.kt b/libraries/tools/kotlin-js-tests-junit/src/test/kotlin/tests/SeleniumTestSuite.kt index f785363ca13..5f0cb0d9cc1 100644 --- a/libraries/tools/kotlin-js-tests-junit/src/test/kotlin/tests/SeleniumTestSuite.kt +++ b/libraries/tools/kotlin-js-tests-junit/src/test/kotlin/tests/SeleniumTestSuite.kt @@ -14,7 +14,7 @@ public class SeleniumTest(val id: String) { println("Testing $id") } - default object { + class object { Parameters public fun findSeleniumUris(): List<String> { return arrayList("a", "b") } diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt index 949e08ea82c..f35778d01a1 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt @@ -150,7 +150,7 @@ $imports if (fields != null) { if (fields.isNotEmpty()) { println("") - println(" public default object {") + println(" public class object {") for (field in fields) { if (field != null) { val modifiers = field.getModifiers() diff --git a/plugins/android-compiler-plugin/src/AndroidComponentRegistrar.kt b/plugins/android-compiler-plugin/src/AndroidComponentRegistrar.kt index 3f261e71d3a..20b868e826b 100644 --- a/plugins/android-compiler-plugin/src/AndroidComponentRegistrar.kt +++ b/plugins/android-compiler-plugin/src/AndroidComponentRegistrar.kt @@ -41,7 +41,7 @@ public object AndroidConfigurationKeys { } public class AndroidCommandLineProcessor : CommandLineProcessor { - default object { + class object { public val ANDROID_COMPILER_PLUGIN_ID: String = "org.jetbrains.kotlin.android" public val RESOURCE_PATH_OPTION: CliOption = CliOption("androidRes", "<path>", "Android resources path") diff --git a/plugins/android-compiler-plugin/src/AndroidExpressionCodegenExtension.kt b/plugins/android-compiler-plugin/src/AndroidExpressionCodegenExtension.kt index df4f1a80e3b..fba8bf7ec70 100644 --- a/plugins/android-compiler-plugin/src/AndroidExpressionCodegenExtension.kt +++ b/plugins/android-compiler-plugin/src/AndroidExpressionCodegenExtension.kt @@ -51,7 +51,7 @@ private enum class AndroidClassType(val internalClassName: String, val supportsC } public class AndroidExpressionCodegenExtension : ExpressionCodegenExtension { - default object { + class object { private val PROPERTY_NAME = "_\$_findViewCache" private val CACHED_FIND_VIEW_BY_ID_METHOD_NAME = "_\$_findCachedViewById" private val CLEAR_CACHE_METHOD_NAME = "_\$_clearFindViewByIdCache" @@ -194,12 +194,12 @@ public class AndroidExpressionCodegenExtension : ExpressionCodegenExtension { context.generateCachedFindViewByIdFunction() context.generateClearCacheFunction() - classBuilder.newField(JvmDeclarationOrigin.Default.NO_ORIGIN, ACC_PRIVATE, PROPERTY_NAME, "Ljava/util/HashMap;", null, null) + classBuilder.newField(JvmDeclarationOrigin.NO_ORIGIN, ACC_PRIVATE, PROPERTY_NAME, "Ljava/util/HashMap;", null, null) } private fun SyntheticPartsGenerateContext.generateClearCacheFunction() { val methodVisitor = classBuilder.newMethod( - JvmDeclarationOrigin.Default.NO_ORIGIN, ACC_PUBLIC, CLEAR_CACHE_METHOD_NAME, "()V", null, null) + JvmDeclarationOrigin.NO_ORIGIN, ACC_PUBLIC, CLEAR_CACHE_METHOD_NAME, "()V", null, null) methodVisitor.visitCode() val iv = InstructionAdapter(methodVisitor) @@ -230,7 +230,7 @@ public class AndroidExpressionCodegenExtension : ExpressionCodegenExtension { val viewType = Type.getObjectType("android/view/View") val methodVisitor = classBuilder.newMethod( - JvmDeclarationOrigin.Default.NO_ORIGIN, ACC_PUBLIC, CACHED_FIND_VIEW_BY_ID_METHOD_NAME, "(I)Landroid/view/View;", null, null) + JvmDeclarationOrigin.NO_ORIGIN, ACC_PUBLIC, CACHED_FIND_VIEW_BY_ID_METHOD_NAME, "(I)Landroid/view/View;", null, null) methodVisitor.visitCode() val iv = InstructionAdapter(methodVisitor) diff --git a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidPsiTreeChangePreprocessor.kt b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidPsiTreeChangePreprocessor.kt index f8702bd995f..9b6d37d3fab 100644 --- a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidPsiTreeChangePreprocessor.kt +++ b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidPsiTreeChangePreprocessor.kt @@ -27,7 +27,7 @@ import com.intellij.psi.PsiFile public class AndroidPsiTreeChangePreprocessor : PsiTreeChangePreprocessor, SimpleModificationTracker() { - default object { + class object { private val HANDLED_EVENTS = setOf( PsiTreeChangeEventImpl.PsiEventType.CHILD_ADDED, PsiTreeChangeEventImpl.PsiEventType.CHILD_MOVED, diff --git a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidResourceManager.kt b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidResourceManager.kt index 475d658fd01..2aa84caf7d9 100644 --- a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidResourceManager.kt +++ b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidResourceManager.kt @@ -70,7 +70,7 @@ public abstract class AndroidResourceManager(val project: Project) { return VirtualFileManager.getInstance().findFileByUrl("file://" + info.mainResDirectory) } - default object { + class object { public fun getInstance(module: Module): AndroidResourceManager { val service = ModuleServiceManager.getService<AndroidResourceManager>(module, javaClass<AndroidResourceManager>()) return service ?: module.getComponent<AndroidResourceManager>(javaClass<AndroidResourceManager>()) diff --git a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidUIXmlProcessor.kt b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidUIXmlProcessor.kt index 3d379fcf604..43b085ce7d0 100644 --- a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidUIXmlProcessor.kt +++ b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidUIXmlProcessor.kt @@ -153,7 +153,7 @@ public abstract class AndroidUIXmlProcessor(protected val project: Project) { return CachedValuesManager.getManager(project).createCachedValue(result, false) } - default object { + class object { private val androidImports = listOf( "android.app.Activity", "android.app.Fragment",