diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/EditCommaSeparatedListHelper.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/EditCommaSeparatedListHelper.kt index 9f0dfaeb51e..8646a70dabd 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/EditCommaSeparatedListHelper.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/EditCommaSeparatedListHelper.kt @@ -21,7 +21,7 @@ import com.intellij.psi.PsiWhiteSpace import org.jetbrains.kotlin.lexer.JetTokens import org.jetbrains.kotlin.psi.psiUtil.siblings -private object EditCommaSeparatedListHelper { +internal object EditCommaSeparatedListHelper { public fun addItem(list: JetElement, allItems: List, item: TItem): TItem { return addItemBefore(list, allItems, item, null) } 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 aa7e81cdf8c..c83139a3cb0 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 @@ -839,19 +839,19 @@ private fun getCompileTimeType(c: JetType): CompileTimeType? { private class CompileTimeType -private val BYTE = CompileTimeType() -private val SHORT = CompileTimeType() -private val INT = CompileTimeType() -private val LONG = CompileTimeType() -private val DOUBLE = CompileTimeType() -private val FLOAT = CompileTimeType() -private val CHAR = CompileTimeType() -private val BOOLEAN = CompileTimeType() -private val STRING = CompileTimeType() -private val ANY = CompileTimeType() +internal val BYTE = CompileTimeType() +internal val SHORT = CompileTimeType() +internal val INT = CompileTimeType() +internal val LONG = CompileTimeType() +internal val DOUBLE = CompileTimeType() +internal val FLOAT = CompileTimeType() +internal val CHAR = CompileTimeType() +internal val BOOLEAN = CompileTimeType() +internal val STRING = CompileTimeType() +internal val ANY = CompileTimeType() @Suppress("UNCHECKED_CAST") -private fun binaryOperation( +internal fun binaryOperation( a: CompileTimeType, b: CompileTimeType, functionName: String, @@ -860,12 +860,12 @@ private fun binaryOperation( ) = BinaryOperationKey(a, b, functionName) to Pair(operation, checker) as Pair, Function2> @Suppress("UNCHECKED_CAST") -private fun unaryOperation( +internal fun unaryOperation( a: CompileTimeType, functionName: String, operation: Function1, checker: Function1 ) = UnaryOperationKey(a, functionName) to Pair(operation, checker) as Pair, Function1> -private data class BinaryOperationKey(val f: CompileTimeType, val s: CompileTimeType, val functionName: String) -private data class UnaryOperationKey(val f: CompileTimeType, val functionName: String) +internal data class BinaryOperationKey(val f: CompileTimeType, val s: CompileTimeType, val functionName: String) +internal data class UnaryOperationKey(val f: CompileTimeType, val functionName: String) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt index 8febef7e49b..61dfb07df48 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt @@ -17,14 +17,14 @@ package org.jetbrains.kotlin.resolve.constants.evaluate import java.math.BigInteger -import java.util.HashMap +import java.util.* /** This file is generated by org.jetbrains.kotlin.generators.evaluate:generate(). DO NOT MODIFY MANUALLY */ -private val emptyBinaryFun: Function2 = { a, b -> BigInteger("0") } -private val emptyUnaryFun: Function1 = { a -> 1.toLong() } +internal val emptyBinaryFun: Function2 = { a, b -> BigInteger("0") } +internal val emptyUnaryFun: Function1 = { a -> 1.toLong() } -private val unaryOperations: HashMap, Pair, Function1>> +internal val unaryOperations: HashMap, Pair, Function1>> = hashMapOf, Pair, Function1>>( unaryOperation(BOOLEAN, "not", { a -> a.not() }, emptyUnaryFun), unaryOperation(BOOLEAN, "toString", { a -> a.toString() }, emptyUnaryFun), @@ -102,7 +102,7 @@ private val unaryOperations: HashMap, Pair a.toString() }, emptyUnaryFun) ) -private val binaryOperations: HashMap, Pair, Function2>> +internal val binaryOperations: HashMap, Pair, Function2>> = hashMapOf, Pair, Function2>>( binaryOperation(BOOLEAN, BOOLEAN, "and", { a, b -> a.and(b) }, emptyBinaryFun), binaryOperation(BOOLEAN, BOOLEAN, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/LazyJavaTypeResolver.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/LazyJavaTypeResolver.kt index 7092254d11a..169332bf382 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/LazyJavaTypeResolver.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/LazyJavaTypeResolver.kt @@ -35,7 +35,6 @@ import org.jetbrains.kotlin.load.java.structure.* import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.platform.JavaToKotlinClassMap import org.jetbrains.kotlin.resolve.jvm.PLATFORM_TYPES -import org.jetbrains.kotlin.resolve.scopes.JetScope import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.Variance.INVARIANT import org.jetbrains.kotlin.types.Variance.IN_VARIANCE @@ -44,7 +43,7 @@ import org.jetbrains.kotlin.types.checker.JetTypeChecker import org.jetbrains.kotlin.types.typeUtil.createProjection import org.jetbrains.kotlin.types.typeUtil.replaceAnnotations import org.jetbrains.kotlin.utils.sure -import java.util.HashSet +import java.util.* private val JAVA_LANG_CLASS_FQ_NAME: FqName = FqName("java.lang.Class") @@ -337,7 +336,7 @@ class LazyJavaTypeResolver( } -private fun makeStarProjection( +internal fun makeStarProjection( typeParameter: TypeParameterDescriptor, attr: JavaTypeAttributes ): TypeProjection { @@ -418,7 +417,7 @@ fun JavaTypeAttributes.toFlexible(flexibility: JavaTypeFlexibility) = // ErasedUpperBound(T : G) = G<*> // UpperBound(T) is a type G with arguments // ErasedUpperBound(T : A) = A // UpperBound(T) is a type A without arguments // ErasedUpperBound(T : F) = UpperBound(F) // UB(T) is another type parameter F -private fun TypeParameterDescriptor.getErasedUpperBound( +internal fun TypeParameterDescriptor.getErasedUpperBound( // Calculation of `potentiallyRecursiveTypeParameter.upperBounds` may recursively depend on `this.getErasedUpperBound` // E.g. `class A` // To prevent recursive calls return defaultValue() instead diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt index e735ffa5fff..63784804c6d 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt @@ -80,7 +80,7 @@ public object RawTypeCapabilities : TypeCapabilities { } } -private object RawSubstitution : TypeSubstitution() { +internal object RawSubstitution : TypeSubstitution() { override fun get(key: JetType) = TypeProjectionImpl(eraseType(key)) private val lowerTypeAttr = TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes().toFlexible(JavaTypeFlexibility.FLEXIBLE_LOWER_BOUND) diff --git a/generators/src/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt b/generators/src/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt index 0987afa8c69..b62338d8811 100644 --- a/generators/src/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt +++ b/generators/src/org/jetbrains/kotlin/generators/evaluate/GenerateOperationsMap.kt @@ -68,10 +68,10 @@ fun generate(): String { } } - p.println("private val emptyBinaryFun: Function2 = { a, b -> BigInteger(\"0\") }") - p.println("private val emptyUnaryFun: Function1 = { a -> 1.toLong() }") + p.println("internal val emptyBinaryFun: Function2 = { a, b -> BigInteger(\"0\") }") + p.println("internal val emptyUnaryFun: Function1 = { a -> 1.toLong() }") p.println() - p.println("private val unaryOperations: HashMap, Pair, Function1>>") + p.println("internal val unaryOperations: HashMap, Pair, Function1>>") p.println(" = hashMapOf, Pair, Function1>>(") p.pushIndent() diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt index 55270e442a8..357628f709b 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/IdeaModuleInfos.kt @@ -29,7 +29,7 @@ import com.intellij.psi.util.CachedValuesManager import org.jetbrains.kotlin.analyzer.ModuleInfo import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.utils.emptyOrSingletonList -import java.util.LinkedHashSet +import java.util.* public val LIBRARY_NAME_PREFIX: String = "library " @@ -111,7 +111,7 @@ public data class ModuleTestSourceInfo(override val module: Module) : ModuleSour }) } -private fun ModuleSourceInfo.isTests() = this is ModuleTestSourceInfo +internal fun ModuleSourceInfo.isTests() = this is ModuleTestSourceInfo public fun Module.productionSourceInfo(): ModuleProductionSourceInfo = ModuleProductionSourceInfo(this) public fun Module.testSourceInfo(): ModuleTestSourceInfo = ModuleTestSourceInfo(this) @@ -160,7 +160,7 @@ public data class LibraryInfo(val project: Project, val library: Library) : Idea override fun toString() = "LibraryInfo(libraryName=${library.getName()})" } -private data class LibrarySourceInfo(val project: Project, val library: Library) : IdeaModuleInfo() { +internal data class LibrarySourceInfo(val project: Project, val library: Library) : IdeaModuleInfo() { override val name: Name = Name.special("") override fun contentScope() = GlobalSearchScope.EMPTY_SCOPE @@ -184,7 +184,7 @@ public data class SdkInfo(val project: Project, val sdk: Sdk) : IdeaModuleInfo() override fun dependencies(): List = listOf(this) } -private object NotUnderContentRootModuleInfo : IdeaModuleInfo() { +internal object NotUnderContentRootModuleInfo : IdeaModuleInfo() { override val name: Name = Name.special("") override fun contentScope() = GlobalSearchScope.EMPTY_SCOPE @@ -201,4 +201,4 @@ private data class LibraryWithoutSourceScope(project: Project, private val libra private data class SdkScope(project: Project, private val sdk: Sdk) : LibraryScopeBase(project, sdk.getRootProvider().getFiles(OrderRootType.CLASSES), arrayOf()) -private fun IdeaModuleInfo.isLibraryClasses() = this is SdkInfo || this is LibraryInfo +internal fun IdeaModuleInfo.isLibraryClasses() = this is SdkInfo || this is LibraryInfo 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 9f456e6bc90..eee0a6d8851 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 @@ -38,7 +38,7 @@ import org.jetbrains.kotlin.resolve.TargetPlatform import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform import org.jetbrains.kotlin.utils.keysToMap -private val LOG = Logger.getInstance(javaClass()) +internal val LOG = Logger.getInstance(javaClass()) public class KotlinCacheService(val project: Project) { companion object { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt index a6325e56306..fcd68adb740 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt @@ -38,9 +38,9 @@ import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf import org.jetbrains.kotlin.resolve.* import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode import org.jetbrains.kotlin.resolve.lazy.ResolveSession -import java.util.HashMap +import java.util.* -private class PerFileAnalysisCache(val file: JetFile, val componentProvider: ComponentProvider) { +internal class PerFileAnalysisCache(val file: JetFile, val componentProvider: ComponentProvider) { private val cache = HashMap() private fun lookUp(analyzableElement: JetElement): AnalysisResult? { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ProjectResolutionFacade.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ProjectResolutionFacade.kt index ad799721f61..1078504958d 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ProjectResolutionFacade.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ProjectResolutionFacade.kt @@ -37,7 +37,7 @@ import org.jetbrains.kotlin.resolve.CompositeBindingContext import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode import org.jetbrains.kotlin.resolve.lazy.ResolveSession -private class ProjectResolutionFacade( +internal class ProjectResolutionFacade( val project: Project, computeModuleResolverProvider: () -> CachedValueProvider.Result ) { @@ -85,7 +85,7 @@ private class ProjectResolutionFacade( } } -private class ResolutionFacadeImpl( +internal class ResolutionFacadeImpl( private val projectFacade: ProjectResolutionFacade, private val moduleInfo: IdeaModuleInfo ) : ResolutionFacade { @@ -128,4 +128,4 @@ private class ResolutionFacadeImpl( return projectFacade.resolverForDescriptor(moduleDescriptor).componentProvider.getService(serviceClass) } -} \ No newline at end of file +} diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderContext.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderContext.kt index dde15313dbd..dc35164c688 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderContext.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderContext.kt @@ -74,7 +74,7 @@ class ClsStubBuilderContext( val typeParameters: TypeParameters ) -private fun ClsStubBuilderContext.child(typeParameterList: List, name: Name? = null): ClsStubBuilderContext { +internal fun ClsStubBuilderContext.child(typeParameterList: List, name: Name? = null): ClsStubBuilderContext { return ClsStubBuilderContext( this.components, this.nameResolver, diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/missingDependencies.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/missingDependencies.kt index fe3d8648c07..20d214f52e4 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/missingDependencies.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/missingDependencies.kt @@ -21,11 +21,11 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorImpl import org.jetbrains.kotlin.descriptors.impl.ConstructorDescriptorImpl import org.jetbrains.kotlin.descriptors.impl.PackageFragmentDescriptorImpl +import org.jetbrains.kotlin.incremental.components.LookupLocation import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.scopes.JetScope import org.jetbrains.kotlin.resolve.scopes.JetScopeImpl -import org.jetbrains.kotlin.incremental.components.LookupLocation import org.jetbrains.kotlin.types.ErrorUtils.createErrorType import org.jetbrains.kotlin.types.TypeProjection import org.jetbrains.kotlin.types.TypeSubstitution @@ -54,7 +54,7 @@ private class ScopeWithMissingDependencies(val fqName: FqName, val containing: D } } -private class PackageFragmentProviderForMissingDependencies(val moduleDescriptor: ModuleDescriptor) : PackageFragmentProvider { +internal class PackageFragmentProviderForMissingDependencies(val moduleDescriptor: ModuleDescriptor) : PackageFragmentProvider { override fun getPackageFragments(fqName: FqName): List { return listOf(PackageFragmentWithMissingDependencies(fqName, moduleDescriptor)) } 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 bdcfc292b53..2ca30460dc7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt @@ -82,8 +82,8 @@ import org.jetbrains.org.objectweb.asm.Opcodes.ASM5 import org.jetbrains.org.objectweb.asm.tree.MethodNode import java.util.* -private val RECEIVER_NAME = "\$receiver" -private val THIS_NAME = "this" +internal val RECEIVER_NAME = "\$receiver" +internal val THIS_NAME = "this" object KotlinEvaluationBuilder: EvaluatorBuilder { override fun build(codeFragment: PsiElement, position: SourcePosition?): ExpressionEvaluator { @@ -535,4 +535,4 @@ fun Type.getClassDescriptor(project: Project): ClassDescriptor? { classes.first().getJavaClassDescriptor() } } -} \ No newline at end of file +} diff --git a/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/JavaPsiUtils.kt b/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/JavaPsiUtils.kt index b871652a13e..b0c4ebed8b4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/JavaPsiUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/JavaPsiUtils.kt @@ -26,7 +26,7 @@ import org.jetbrains.kotlin.psi.JetClass import org.jetbrains.kotlin.psi.JetFunction import org.jetbrains.kotlin.psi.JetNamedFunction import org.jetbrains.kotlin.psi.JetSecondaryConstructor -import java.util.HashSet +import java.util.* fun collectContainingClasses(methods: Collection): Set { val classes = HashSet() @@ -41,7 +41,7 @@ fun collectContainingClasses(methods: Collection): Set { return classes } -private fun getPsiClass(element: PsiElement?): PsiClass? { +internal fun getPsiClass(element: PsiElement?): PsiClass? { return when { element == null -> null element is PsiClass -> element @@ -51,7 +51,7 @@ private fun getPsiClass(element: PsiElement?): PsiClass? { } } -private fun getPsiMethod(element: PsiElement?): PsiMethod? { +internal fun getPsiMethod(element: PsiElement?): PsiMethod? { val parent = element?.getParent() return when { element == null -> null diff --git a/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/OverridenFunctionMarker.kt b/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/OverridenFunctionMarker.kt index 5b53500984e..995f6b264ef 100644 --- a/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/OverridenFunctionMarker.kt +++ b/idea/src/org/jetbrains/kotlin/idea/highlighter/markers/OverridenFunctionMarker.kt @@ -16,34 +16,34 @@ package org.jetbrains.kotlin.idea.highlighter.markers -import com.intellij.psi.PsiMethod -import com.intellij.psi.search.PsiElementProcessor -import com.intellij.psi.search.searches.OverridingMethodsSearch -import com.intellij.psi.PsiModifier import com.intellij.codeInsight.daemon.DaemonBundle -import com.intellij.ide.util.MethodCellRenderer import com.intellij.codeInsight.daemon.impl.GutterIconTooltipHelper -import java.awt.event.MouseEvent -import com.intellij.openapi.project.DumbService -import com.intellij.openapi.progress.ProgressManager -import javax.swing.JComponent -import com.intellij.psi.util.PsiUtil import com.intellij.codeInsight.daemon.impl.PsiElementListNavigator import com.intellij.codeInsight.navigation.ListBackgroundUpdaterTask +import com.intellij.ide.util.MethodCellRenderer import com.intellij.ide.util.PsiElementListCellRenderer import com.intellij.openapi.progress.ProgressIndicator -import com.intellij.util.CommonProcessors -import com.intellij.psi.search.PsiElementProcessorAdapter -import com.intellij.psi.PsiElement -import gnu.trove.THashSet -import com.intellij.psi.PsiClass -import com.intellij.psi.search.searches.AllOverridingMethodsSearch +import com.intellij.openapi.progress.ProgressManager +import com.intellij.openapi.project.DumbService import com.intellij.openapi.util.Pair -import java.util.HashSet +import com.intellij.psi.PsiClass +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiMethod +import com.intellij.psi.PsiModifier +import com.intellij.psi.search.PsiElementProcessor +import com.intellij.psi.search.PsiElementProcessorAdapter +import com.intellij.psi.search.searches.AllOverridingMethodsSearch +import com.intellij.psi.search.searches.OverridingMethodsSearch +import com.intellij.psi.util.PsiUtil +import com.intellij.util.CommonProcessors import com.intellij.util.Processor +import gnu.trove.THashSet import org.jetbrains.kotlin.asJava.KotlinLightMethodForTraitFakeOverride +import java.awt.event.MouseEvent +import java.util.* +import javax.swing.JComponent -private fun getOverriddenDeclarations(mappingToJava: MutableMap, classes: Set): Set { +internal fun getOverriddenDeclarations(mappingToJava: MutableMap, classes: Set): Set { val overridden = HashSet() for (aClass in classes) { AllOverridingMethodsSearch.search(aClass)!!.forEach(object : Processor> { diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt index 8d12189e7dd..82fcb538a08 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt @@ -1069,7 +1069,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) { } } -private fun JetNamedDeclaration.getReturnTypeReference(): JetTypeReference? { +internal fun JetNamedDeclaration.getReturnTypeReference(): JetTypeReference? { return when (this) { is JetCallableDeclaration -> getTypeReference() is JetClassOrObject -> getDelegationSpecifiers().firstOrNull()?.getTypeReference() diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/templateExpressions.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/templateExpressions.kt index 34c59500c74..3e2a4c82ce8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/templateExpressions.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/templateExpressions.kt @@ -39,7 +39,7 @@ import java.util.LinkedHashSet /** * Special Expression for parameter names based on its type. */ -private class ParameterNameExpression( +internal class ParameterNameExpression( private val names: Array, private val parameterTypeToNamesMap: Map>) : Expression() { init { @@ -102,7 +102,7 @@ private class ParameterNameExpression( /** * An Expression for type references and delegation specifiers. */ -private abstract class TypeExpression(public val typeCandidates: List) : Expression() { +internal abstract class TypeExpression(public val typeCandidates: List) : Expression() { class ForTypeReference(typeCandidates: List) : TypeExpression(typeCandidates) { override val cachedLookupElements: Array = typeCandidates.map { LookupElementBuilder.create(it, it.renderedType!!) }.toTypedArray() @@ -132,7 +132,7 @@ private abstract class TypeExpression(public val typeCandidates: ListExpression for parameter lists, to allow us to update the parameter list as the user makes selections. */ -private class TypeParameterListExpression(private val mandatoryTypeParameters: List, +internal class TypeParameterListExpression(private val mandatoryTypeParameters: List, private val parameterTypeToTypeParameterNamesMap: Map>, insertLeadingSpace: Boolean) : Expression() { private val prefix = if (insertLeadingSpace) " <" else "<" @@ -185,7 +185,7 @@ private class TypeParameterListExpression(private val mandatoryTypeParameters: L override fun calculateLookupItems(context: ExpressionContext?) = arrayOf() } -private object ValVarExpression: Expression() { +internal object ValVarExpression: Expression() { private val cachedLookupElements = listOf("val", "var").map { LookupElementBuilder.create(it) }.toTypedArray() override fun calculateResult(context: ExpressionContext?): Result? = TextResult("val") diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt index 036e407df55..e485db61244 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt @@ -40,7 +40,7 @@ import org.jetbrains.kotlin.types.checker.JetTypeChecker import org.jetbrains.kotlin.types.typeUtil.makeNotNullable import java.util.* -private fun JetType.contains(inner: JetType): Boolean { +internal fun JetType.contains(inner: JetType): Boolean { return JetTypeChecker.DEFAULT.equalTypes(this, inner) || getArguments().any { inner in it.getType() } } @@ -61,10 +61,10 @@ private fun JetType.render(typeParameterNameMap: Map) = render(typeParameterNameMap, false) -private fun JetType.renderLong(typeParameterNameMap: Map) = render(typeParameterNameMap, true) +internal fun JetType.renderShort(typeParameterNameMap: Map) = render(typeParameterNameMap, false) +internal fun JetType.renderLong(typeParameterNameMap: Map) = render(typeParameterNameMap, true) -private fun getTypeParameterNamesNotInScope(typeParameters: Collection, scope: JetScope): List { +internal fun getTypeParameterNamesNotInScope(typeParameters: Collection, scope: JetScope): List { return typeParameters.filter { typeParameter -> val classifier = scope.getClassifier(typeParameter.name, NoLookupLocation.FROM_IDE) classifier == null || classifier != typeParameter @@ -215,9 +215,9 @@ private fun JetNamedDeclaration.guessType(context: BindingContext): ArrayJetType by another JetType. */ -private class JetTypeSubstitution(public val forType: JetType, public val byType: JetType) +internal class JetTypeSubstitution(public val forType: JetType, public val byType: JetType) -private fun JetType.substitute(substitution: JetTypeSubstitution, variance: Variance): JetType { +internal fun JetType.substitute(substitution: JetTypeSubstitution, variance: Variance): JetType { val nullable = isMarkedNullable() val currentType = makeNotNullable() diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/createClassUtils.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/createClassUtils.kt index 221f630d05b..ac56edb0fc6 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/createClassUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/createClassUtils.kt @@ -43,11 +43,11 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.descriptors.ClassKind as ClassDescriptorKind -private fun String.checkClassName(): Boolean = isNotEmpty() && Character.isUpperCase(first()) +internal fun String.checkClassName(): Boolean = isNotEmpty() && Character.isUpperCase(first()) private fun String.checkPackageName(): Boolean = isNotEmpty() && Character.isLowerCase(first()) -private fun getTargetParentByQualifier( +internal fun getTargetParentByQualifier( file: JetFile, isQualified: Boolean, qualifierDescriptor: DeclarationDescriptor?): PsiElement? { @@ -68,7 +68,7 @@ private fun getTargetParentByQualifier( return if (targetParent.canRefactor()) return targetParent else null } -private fun getTargetParentByCall(call: Call, file: JetFile): PsiElement? { +internal fun getTargetParentByCall(call: Call, file: JetFile): PsiElement? { val receiver = call.getExplicitReceiver() return when (receiver) { ReceiverValue.NO_RECEIVER -> getTargetParentByQualifier(file, false, null) @@ -77,12 +77,12 @@ private fun getTargetParentByCall(call: Call, file: JetFile): PsiElement? { } } -private fun isInnerClassExpected(call: Call): Boolean { +internal fun isInnerClassExpected(call: Call): Boolean { val receiver = call.getExplicitReceiver() return receiver != ReceiverValue.NO_RECEIVER && receiver !is Qualifier } -private fun JetExpression.getInheritableTypeInfo( +internal fun JetExpression.getInheritableTypeInfo( context: BindingContext, moduleDescriptor: ModuleDescriptor, containingDeclaration: PsiElement): Pair Boolean> { @@ -108,7 +108,7 @@ private fun JetExpression.getInheritableTypeInfo( } } -private fun JetSimpleNameExpression.getCreatePackageFixIfApplicable(targetParent: PsiElement): IntentionAction? { +internal fun JetSimpleNameExpression.getCreatePackageFixIfApplicable(targetParent: PsiElement): IntentionAction? { val name = getReferencedName() if (!name.checkPackageName()) return null 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 bc553b43233..f5c8ec97a11 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 @@ -257,7 +257,7 @@ data class ExtractionData( // Hack: // we can't get first element offset through getStatement()/getChildren() since they skip comments and whitespaces // So we take offset of the left brace instead and increase it by 2 (which is length of "{\n" separating block start and its first element) -private fun JetExpression.getBlockContentOffset(): Int { +internal fun JetExpression.getBlockContentOffset(): Int { (this as? JetBlockExpression)?.getLBrace()?.let { return it.getTextRange()!!.getStartOffset() + 2 } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt index c21ce08a087..7d142c18cf2 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt @@ -89,7 +89,7 @@ import org.jetbrains.kotlin.utils.DFS.Neighbors import org.jetbrains.kotlin.utils.DFS.VisitedWithSet import java.util.* -private val DEFAULT_RETURN_TYPE = KotlinBuiltIns.getInstance().getUnitType() +internal val DEFAULT_RETURN_TYPE = KotlinBuiltIns.getInstance().getUnitType() private val DEFAULT_PARAMETER_TYPE = KotlinBuiltIns.getInstance().getNullableAnyType() private fun DeclarationDescriptor.renderForMessage(): String = @@ -104,7 +104,7 @@ private fun JetType.renderForMessage(): String = TYPE_RENDERER.renderType(this) private fun JetDeclaration.renderForMessage(bindingContext: BindingContext): String? = bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, this]?.renderForMessage() -private fun JetType.isDefault(): Boolean = KotlinBuiltIns.isUnit(this) +internal fun JetType.isDefault(): Boolean = KotlinBuiltIns.isUnit(this) private fun List.getModifiedVarDescriptors(bindingContext: BindingContext): Map> { val result = HashMap>() @@ -968,7 +968,7 @@ private fun ExtractionData.suggestFunctionNames(returnType: JetType): List getBodyExpression() else -> { diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpConflictsUtils.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpConflictsUtils.kt index 317907c4db9..1f18b55a647 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpConflictsUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpConflictsUtils.kt @@ -83,7 +83,7 @@ fun DeclarationDescriptor.renderForConflicts(): String { } } -private fun KotlinPullUpData.getClashingMemberInTargetClass(memberDescriptor: CallableMemberDescriptor): CallableMemberDescriptor? { +internal fun KotlinPullUpData.getClashingMemberInTargetClass(memberDescriptor: CallableMemberDescriptor): CallableMemberDescriptor? { val memberInSuper = memberDescriptor.substitute(sourceToTargetClassSubstitutor) ?: return null return targetClassDescriptor.findCallableMemberBySignature(memberInSuper as CallableMemberDescriptor) } diff --git a/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/AbstractClsStubBuilderTest.kt b/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/AbstractClsStubBuilderTest.kt index 89273d5637d..9ccc5425922 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/AbstractClsStubBuilderTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/AbstractClsStubBuilderTest.kt @@ -16,22 +16,22 @@ package org.jetbrains.kotlin.idea.decompiler.stubBuilder -import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase -import org.jetbrains.kotlin.psi.stubs.elements.JetFileStubBuilder -import org.jetbrains.kotlin.test.JetTestUtils -import java.io.File -import org.jetbrains.kotlin.test.MockLibraryUtil +import com.google.common.io.Files import com.intellij.openapi.vfs.LocalFileSystem -import com.intellij.util.indexing.FileContentImpl +import com.intellij.openapi.vfs.VfsUtilCore +import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.PsiElement import com.intellij.psi.stubs.StubElement -import com.google.common.io.Files -import com.intellij.openapi.vfs.VirtualFile -import org.junit.Assert +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase +import com.intellij.util.indexing.FileContentImpl import org.jetbrains.kotlin.idea.stubs.AbstractStubBuilderTest -import java.util.LinkedHashSet -import com.intellij.openapi.vfs.VfsUtilCore +import org.jetbrains.kotlin.psi.stubs.elements.JetFileStubBuilder +import org.jetbrains.kotlin.test.JetTestUtils +import org.jetbrains.kotlin.test.MockLibraryUtil import org.jetbrains.kotlin.utils.addIfNotNull +import org.junit.Assert +import java.io.File +import java.util.* public abstract class AbstractClsStubBuilderTest : LightCodeInsightFixtureTestCase() { fun doTest(sourcePath: String) { @@ -64,7 +64,7 @@ public abstract class AbstractClsStubBuilderTest : LightCodeInsightFixtureTestCa } } -private fun StubElement.serializeToString(): String { +internal fun StubElement.serializeToString(): String { return AbstractStubBuilderTest.serializeStubToString(this) } diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt index 0be6e29f252..f9b5f0a3120 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt @@ -16,7 +16,7 @@ package com.google.dart.compiler.backend.js.ast.metadata -private class MetadataProperty(val default: R) { +internal class MetadataProperty(val default: R) { fun get(thisRef: T, desc: PropertyMetadata): R { if (!thisRef.hasData(desc.name)) return default return thisRef.getData(desc.name) diff --git a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/NodeRemover.kt b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/NodeRemover.kt index ee2cf2c58ce..3d50d3aefc0 100644 --- a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/NodeRemover.kt +++ b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/NodeRemover.kt @@ -16,11 +16,11 @@ package org.jetbrains.kotlin.js.inline.clean -import com.google.dart.compiler.backend.js.ast.JsVisitorWithContextImpl -import com.google.dart.compiler.backend.js.ast.JsNode import com.google.dart.compiler.backend.js.ast.JsContext +import com.google.dart.compiler.backend.js.ast.JsNode +import com.google.dart.compiler.backend.js.ast.JsVisitorWithContextImpl -private class NodeRemover(val klass: Class, val predicate: (T) -> Boolean): JsVisitorWithContextImpl() { +internal class NodeRemover(val klass: Class, val predicate: (T) -> Boolean): JsVisitorWithContextImpl() { override fun doTraverse(node: T, ctx: JsContext<*>) { if (klass.isInstance(node)) { diff --git a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/ReferenceTracker.kt b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/ReferenceTracker.kt index 8375464e6b8..5926f7f70d1 100644 --- a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/ReferenceTracker.kt +++ b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/clean/ReferenceTracker.kt @@ -16,12 +16,11 @@ package org.jetbrains.kotlin.js.inline.clean -import com.google.dart.compiler.backend.js.ast.* +import com.google.dart.compiler.backend.js.ast.JsNode import org.jetbrains.kotlin.js.inline.util.IdentitySet +import java.util.* -import java.util.IdentityHashMap - -private class ReferenceTracker { +internal class ReferenceTracker { private val reachable = IdentityHashMap() private val removableCandidates = IdentityHashMap() private val referenceFromTo = IdentityHashMap>() diff --git a/js/js.libraries/src/core/kotlin.kt b/js/js.libraries/src/core/kotlin.kt index 3ef1049270a..24da6f117cd 100644 --- a/js/js.libraries/src/core/kotlin.kt +++ b/js/js.libraries/src/core/kotlin.kt @@ -70,11 +70,11 @@ public fun lazy(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy = public fun lazy(lock: Any?, initializer: () -> T): Lazy = UnsafeLazyImpl(initializer) -private fun arrayOfNulls(reference: Array, size: Int): Array { +internal fun arrayOfNulls(reference: Array, size: Int): Array { return arrayOfNulls(size) as Array } -private fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): dynamic { +internal fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): dynamic { val result = source.slice(0, newSize) var index: Int = source.length if (newSize > index) { @@ -84,10 +84,10 @@ private fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): return result } -private fun arrayPlusCollection(array: dynamic, collection: Collection): dynamic { +internal fun arrayPlusCollection(array: dynamic, collection: Collection): dynamic { val result = array.slice(0) result.length += collection.size() var index: Int = array.length for (element in collection) result[index++] = element return result -} \ No newline at end of file +} diff --git a/js/js.libraries/src/core/sequence.kt b/js/js.libraries/src/core/sequence.kt index 3a7ef9e2b90..8325edbbe68 100644 --- a/js/js.libraries/src/core/sequence.kt +++ b/js/js.libraries/src/core/sequence.kt @@ -16,7 +16,7 @@ package kotlin -private class ConstrainedOnceSequence(sequence: Sequence) : Sequence { +internal class ConstrainedOnceSequence(sequence: Sequence) : Sequence { @Volatile private var sequenceRef: Sequence? = sequence //private val lock = Any() @@ -26,4 +26,4 @@ private class ConstrainedOnceSequence(sequence: Sequence) : Sequence { sequenceRef = null return sequence.iterator() } -} \ No newline at end of file +} diff --git a/libraries/stdlib/src/kotlin/collections/ArraysJVM.kt b/libraries/stdlib/src/kotlin/collections/ArraysJVM.kt index 0f904148d19..03ff1b85b5a 100644 --- a/libraries/stdlib/src/kotlin/collections/ArraysJVM.kt +++ b/libraries/stdlib/src/kotlin/collections/ArraysJVM.kt @@ -5,7 +5,6 @@ package kotlin import java.io.ByteArrayInputStream import java.nio.charset.Charset -import java.util.Arrays import kotlin.jvm.internal.Intrinsic // Array "constructor" @@ -104,6 +103,6 @@ public inline fun Collection.toTypedArray(): Array { public inline fun Array?.orEmpty(): Array = this ?: arrayOf() /** Internal unsafe construction of array based on reference array type */ -private fun arrayOfNulls(reference: Array, size: Int): Array { +internal fun arrayOfNulls(reference: Array, size: Int): Array { return java.lang.reflect.Array.newInstance(reference.javaClass.componentType, size) as Array -} \ No newline at end of file +} diff --git a/libraries/stdlib/src/kotlin/collections/JUtil.kt b/libraries/stdlib/src/kotlin/collections/JUtil.kt index eb92dacdb9a..8103c0920d4 100644 --- a/libraries/stdlib/src/kotlin/collections/JUtil.kt +++ b/libraries/stdlib/src/kotlin/collections/JUtil.kt @@ -6,7 +6,7 @@ package kotlin import java.io.Serializable import java.util.* -private object EmptyIterator : ListIterator { +internal object EmptyIterator : ListIterator { override fun hasNext(): Boolean = false override fun hasPrevious(): Boolean = false override fun nextIndex(): Int = 0 @@ -15,7 +15,7 @@ private object EmptyIterator : ListIterator { override fun previous(): Nothing = throw NoSuchElementException() } -private object EmptyList : List, Serializable { +internal object EmptyList : List, Serializable { override fun equals(other: Any?): Boolean = other is List<*> && other.isEmpty() override fun hashCode(): Int = 1 override fun toString(): String = "[]" @@ -125,7 +125,7 @@ public fun Iterable.collectionSizeOrDefault(default: Int): Int = if (this private fun Collection.safeToConvertToSet() = size() > 2 && this is ArrayList /** Converts this collection to a set, when it's worth so and it doesn't change contains method behavior. */ -private fun Iterable.convertToSetForSetOperationWith(source: Iterable): Collection = +internal fun Iterable.convertToSetForSetOperationWith(source: Iterable): Collection = when(this) { is Set -> this is Collection -> @@ -137,7 +137,7 @@ private fun Iterable.convertToSetForSetOperationWith(source: Iterable) } /** Converts this collection to a set, when it's worth so and it doesn't change contains method behavior. */ -private fun Iterable.convertToSetForSetOperation(): Collection = +internal fun Iterable.convertToSetForSetOperation(): Collection = when(this) { is Set -> this is Collection -> if (this.safeToConvertToSet()) toHashSet() else this diff --git a/libraries/stdlib/src/kotlin/collections/Maps.kt b/libraries/stdlib/src/kotlin/collections/Maps.kt index 658e491203e..acc82f6d6e4 100644 --- a/libraries/stdlib/src/kotlin/collections/Maps.kt +++ b/libraries/stdlib/src/kotlin/collections/Maps.kt @@ -79,7 +79,7 @@ public fun linkedMapOf(vararg values: Pair): LinkedHashMap { private val INT_MAX_POWER_OF_TWO: Int = Int.MAX_VALUE / 2 + 1 -private fun mapCapacity(expectedSize: Int): Int { +internal fun mapCapacity(expectedSize: Int): Int { if (expectedSize < 3) { return expectedSize + 1 } diff --git a/libraries/stdlib/src/kotlin/collections/Sequence.kt b/libraries/stdlib/src/kotlin/collections/Sequence.kt index 0eb03fe0fc3..b315220824b 100644 --- a/libraries/stdlib/src/kotlin/collections/Sequence.kt +++ b/libraries/stdlib/src/kotlin/collections/Sequence.kt @@ -96,7 +96,7 @@ public fun Sequence>.unzip(): Pair, List> { * @param sendWhen If `true`, values for which the predicate returns `true` are returned. Otherwise, * values for which the predicate returns `false` are returned */ -private class FilteringSequence(private val sequence: Sequence, +internal class FilteringSequence(private val sequence: Sequence, private val sendWhen: Boolean = true, private val predicate: (T) -> Boolean ) : Sequence { @@ -142,7 +142,7 @@ private class FilteringSequence(private val sequence: Sequence, * in the underlying [sequence]. */ -private class TransformingSequence +internal class TransformingSequence constructor(private val sequence: Sequence, private val transformer: (T) -> R) : Sequence { override fun iterator(): Iterator = object : Iterator { val iterator = sequence.iterator() @@ -161,7 +161,7 @@ constructor(private val sequence: Sequence, private val transformer: (T) -> R * in the underlying [sequence], where the transformer function takes the index of the value in the underlying * sequence along with the value itself. */ -private class TransformingIndexedSequence +internal class TransformingIndexedSequence constructor(private val sequence: Sequence, private val transformer: (Int, T) -> R) : Sequence { override fun iterator(): Iterator = object : Iterator { val iterator = sequence.iterator() @@ -180,7 +180,7 @@ constructor(private val sequence: Sequence, private val transformer: (Int, T) * A sequence which combines values from the underlying [sequence] with their indices and returns them as * [IndexedValue] objects. */ -private class IndexingSequence +internal class IndexingSequence constructor(private val sequence: Sequence) : Sequence> { override fun iterator(): Iterator> = object : Iterator> { val iterator = sequence.iterator() @@ -200,7 +200,7 @@ constructor(private val sequence: Sequence) : Sequence> { * [transform] function and returns the values returned by that function. The sequence stops returning * values as soon as one of the underlying sequences stops returning values. */ -private class MergingSequence +internal class MergingSequence constructor(private val sequence1: Sequence, private val sequence2: Sequence, private val transform: (T1, T2) -> V @@ -218,7 +218,7 @@ private class MergingSequence } } -private class FlatteningSequence +internal class FlatteningSequence constructor(private val sequence: Sequence, private val transformer: (T) -> Sequence ) : Sequence { @@ -257,7 +257,7 @@ private class FlatteningSequence } } -private class MultiSequence +internal class MultiSequence constructor(private val sequence: Sequence>) : Sequence { override fun iterator(): Iterator = object : Iterator { val iterator = sequence.iterator() @@ -298,7 +298,7 @@ constructor(private val sequence: Sequence>) : Sequence { * A sequence that returns at most [count] values from the underlying [sequence], and stops returning values * as soon as that count is reached. */ -private class TakeSequence +internal class TakeSequence constructor(private val sequence: Sequence, private val count: Int ) : Sequence { @@ -327,7 +327,7 @@ private class TakeSequence * A sequence that returns values from the underlying [sequence] while the [predicate] function returns * `true`, and stops returning values once the function returns `false` for the next element. */ -private class TakeWhileSequence +internal class TakeWhileSequence constructor(private val sequence: Sequence, private val predicate: (T) -> Boolean ) : Sequence { @@ -373,7 +373,7 @@ private class TakeWhileSequence * A sequence that skips the specified number of values from the underlying [sequence] and returns * all values after that. */ -private class DropSequence +internal class DropSequence constructor(private val sequence: Sequence, private val count: Int ) : Sequence { @@ -409,7 +409,7 @@ private class DropSequence * A sequence that skips the values from the underlying [sequence] while the given [predicate] returns `true` and returns * all values after that. */ -private class DropWhileSequence +internal class DropWhileSequence constructor(private val sequence: Sequence, private val predicate: (T) -> Boolean ) : Sequence { @@ -452,7 +452,7 @@ private class DropWhileSequence } } -private class DistinctSequence(private val source : Sequence, private val keySelector : (T) -> K) : Sequence { +internal class DistinctSequence(private val source : Sequence, private val keySelector : (T) -> K) : Sequence { override fun iterator(): Iterator = DistinctIterator(source.iterator(), keySelector) } diff --git a/libraries/stdlib/src/kotlin/collections/SequenceJVM.kt b/libraries/stdlib/src/kotlin/collections/SequenceJVM.kt index 0a8690c5dee..a542c32d1be 100644 --- a/libraries/stdlib/src/kotlin/collections/SequenceJVM.kt +++ b/libraries/stdlib/src/kotlin/collections/SequenceJVM.kt @@ -6,7 +6,7 @@ package kotlin import java.util.concurrent.atomic.AtomicReference -private class ConstrainedOnceSequence(sequence: Sequence) : Sequence { +internal class ConstrainedOnceSequence(sequence: Sequence) : Sequence { private val sequenceRef = AtomicReference(sequence) override fun iterator(): Iterator { diff --git a/libraries/stdlib/src/kotlin/collections/Sets.kt b/libraries/stdlib/src/kotlin/collections/Sets.kt index e2fd45529a7..c48ba38bf20 100644 --- a/libraries/stdlib/src/kotlin/collections/Sets.kt +++ b/libraries/stdlib/src/kotlin/collections/Sets.kt @@ -7,7 +7,7 @@ import java.io.Serializable import java.util.* -private object EmptySet : Set, Serializable { +internal object EmptySet : Set, Serializable { override fun equals(other: Any?): Boolean = other is Set<*> && other.isEmpty() override fun hashCode(): Int = 0 override fun toString(): String = "[]" @@ -59,4 +59,4 @@ public fun sortedSetOf(vararg values: T): TreeSet = values.toCollection(Tr * Returns a new [SortedSet] with the given [comparator] and elements. */ @JvmVersion -public fun sortedSetOf(comparator: Comparator, vararg values: T): TreeSet = values.toCollection(TreeSet(comparator)) \ No newline at end of file +public fun sortedSetOf(comparator: Comparator, vararg values: T): TreeSet = values.toCollection(TreeSet(comparator)) diff --git a/libraries/stdlib/src/kotlin/text/StringsJVM.kt b/libraries/stdlib/src/kotlin/text/StringsJVM.kt index c24cf6a36ea..5e27b8690c5 100644 --- a/libraries/stdlib/src/kotlin/text/StringsJVM.kt +++ b/libraries/stdlib/src/kotlin/text/StringsJVM.kt @@ -14,22 +14,22 @@ import kotlin.text.Regex /** * Returns the index within this string of the first occurrence of the specified character, starting from the specified offset. */ -private fun String.nativeIndexOf(ch: Char, fromIndex: Int): Int = (this as java.lang.String).indexOf(ch.toInt(), fromIndex) +internal fun String.nativeIndexOf(ch: Char, fromIndex: Int): Int = (this as java.lang.String).indexOf(ch.toInt(), fromIndex) /** * Returns the index within this string of the first occurrence of the specified substring, starting from the specified offset. */ -private fun String.nativeIndexOf(str: String, fromIndex: Int): Int = (this as java.lang.String).indexOf(str, fromIndex) +internal fun String.nativeIndexOf(str: String, fromIndex: Int): Int = (this as java.lang.String).indexOf(str, fromIndex) /** * Returns the index within this string of the last occurrence of the specified character. */ -private fun String.nativeLastIndexOf(ch: Char, fromIndex: Int): Int = (this as java.lang.String).lastIndexOf(ch.toInt(), fromIndex) +internal fun String.nativeLastIndexOf(ch: Char, fromIndex: Int): Int = (this as java.lang.String).lastIndexOf(ch.toInt(), fromIndex) /** * Returns the index within this string of the last occurrence of the specified character, starting from the specified offset. */ -private fun String.nativeLastIndexOf(str: String, fromIndex: Int): Int = (this as java.lang.String).lastIndexOf(str, fromIndex) +internal fun String.nativeLastIndexOf(str: String, fromIndex: Int): Int = (this as java.lang.String).lastIndexOf(str, fromIndex) /** diff --git a/libraries/stdlib/src/kotlin/util/Lazy.kt b/libraries/stdlib/src/kotlin/util/Lazy.kt index bde2c997d82..f04e842e06b 100644 --- a/libraries/stdlib/src/kotlin/util/Lazy.kt +++ b/libraries/stdlib/src/kotlin/util/Lazy.kt @@ -54,7 +54,7 @@ public enum class LazyThreadSafetyMode { private object UNINITIALIZED_VALUE -private open class LazyImpl(initializer: () -> T) : Lazy(), Serializable { +internal open class LazyImpl(initializer: () -> T) : Lazy(), Serializable { private var initializer: (() -> T)? = initializer @Volatile private var _value: Any? = UNINITIALIZED_VALUE protected open val lock: Any @@ -88,9 +88,9 @@ private open class LazyImpl(initializer: () -> T) : Lazy(), Serializab private fun writeReplace(): Any = InitializedLazyImpl(value) } -private class ExternallySynchronizedLazyImpl(override val lock: Any, initializer: () -> T): LazyImpl(initializer) +internal class ExternallySynchronizedLazyImpl(override val lock: Any, initializer: () -> T): LazyImpl(initializer) -private class UnsafeLazyImpl(initializer: () -> T) : Lazy(), Serializable { +internal class UnsafeLazyImpl(initializer: () -> T) : Lazy(), Serializable { private var initializer: (() -> T)? = initializer private var _value: Any? = UNINITIALIZED_VALUE diff --git a/libraries/stdlib/src/kotlin/util/Ranges.kt b/libraries/stdlib/src/kotlin/util/Ranges.kt index 7eb51e5362c..edc1d799e0b 100644 --- a/libraries/stdlib/src/kotlin/util/Ranges.kt +++ b/libraries/stdlib/src/kotlin/util/Ranges.kt @@ -32,6 +32,6 @@ public fun > T.rangeTo(that: T): ComparableRange { } -private fun checkStepIsPositive(isPositive: Boolean, step: Number) { +internal fun checkStepIsPositive(isPositive: Boolean, step: Number) { if (!isPositive) throw IllegalArgumentException("Step must be positive, was: $step") } diff --git a/libraries/tools/kotlin-annotation-processing/src/main/kotlin/org/jetbrains/kotlin/annotation/RoundEnvironmentWrapper.kt b/libraries/tools/kotlin-annotation-processing/src/main/kotlin/org/jetbrains/kotlin/annotation/RoundEnvironmentWrapper.kt index 3c02d7d1325..9c073fa3bec 100644 --- a/libraries/tools/kotlin-annotation-processing/src/main/kotlin/org/jetbrains/kotlin/annotation/RoundEnvironmentWrapper.kt +++ b/libraries/tools/kotlin-annotation-processing/src/main/kotlin/org/jetbrains/kotlin/annotation/RoundEnvironmentWrapper.kt @@ -9,7 +9,7 @@ import javax.lang.model.element.TypeElement import javax.lang.model.type.NoType import javax.lang.model.type.TypeVisitor -private class RoundEnvironmentWrapper( +internal class RoundEnvironmentWrapper( val processingEnv: ProcessingEnvironment, val parent: RoundEnvironment, val roundNumber: Int, diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/kotlinPluginVersion.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/kotlinPluginVersion.kt index b430f891c36..d156b54ffd5 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/kotlinPluginVersion.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/kotlinPluginVersion.kt @@ -20,7 +20,7 @@ import org.gradle.api.logging.Logger import java.io.FileNotFoundException import java.util.* -private fun Any.loadKotlinVersionFromResource(log: Logger): String { +internal fun Any.loadKotlinVersionFromResource(log: Logger): String { log.kotlinDebug("Loading version information") val props = Properties() val propFileName = "project.properties" @@ -35,4 +35,4 @@ private fun Any.loadKotlinVersionFromResource(log: Logger): String { val projectVersion = props["project.version"] as String log.kotlinDebug("Found project version [$projectVersion]") return projectVersion -} \ No newline at end of file +}