Skip to content

Commit

Permalink
fix - reduce member visibility (public -> private)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: fe8a4740e27d192798a9fa55ff41112d1b633e49
  • Loading branch information
develar authored and intellij-monorepo-bot committed Sep 14, 2022
1 parent 2917968 commit 48de473
Show file tree
Hide file tree
Showing 170 changed files with 294 additions and 293 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ open class RangedSeries<E>
/**
* The range of the data
*/
protected val intersectRange: Range = Range(-Double.MAX_VALUE, Double.MAX_VALUE)) {
private val intersectRange: Range = Range(-Double.MAX_VALUE, Double.MAX_VALUE)) {

private var lastQueriedRange = Range()
private var lastQueriedSeries = emptyList<SeriesData<E>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TrackGroupModel private constructor(builder: Builder) : DragAndDropListMod
private val selector: Selector? = builder.selector
val boxSelectionModel: BoxSelectionModel? = builder.boxSelectionModel
val allDisplayToggles: List<String> = builder.toggles.keys.toList()
val displayToggleChangeListeners: Map<String, Runnable> = builder.toggles.mapValues { (_, rec) -> rec.second }
private val displayToggleChangeListeners: Map<String, Runnable> = builder.toggles.mapValues { (_, rec) -> rec.second }
var activeDisplayToggles: Set<String> = builder.toggles.filterValues { it.first }.keys.toSet()

private val observer = AspectObserver()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private const val ICON_SIDES_MARGIN = 4
*
* Since the panel will have the TextField appearance, [textField] and [leftComponent] are stripped from their border and background.
*/
class TextFieldWithLeftComponent(val leftComponent: JComponent, val textField: JTextField) : JPanel(BorderLayout()) {
class TextFieldWithLeftComponent(private val leftComponent: JComponent, val textField: JTextField) : JPanel(BorderLayout()) {
private val focusListener: FocusListener = object : FocusListener {
override fun focusLost(e: FocusEvent?) {
repaint()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import kotlin.math.roundToInt
* A [JBPanel] that shows an [Image] as background, scaled to fit preserving the aspect ratio.
* Quality of scaling is controlled by the [highFidelityScaling] parameter.
*/
class ImagePanel(val highFidelityScaling: Boolean = false) : JBPanel<ImagePanel>(true) {
class ImagePanel(private val highFidelityScaling: Boolean = false) : JBPanel<ImagePanel>(true) {
var image: Image? = null
set(value) {
field = value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HighlightingStats : Disposable {
* Logs an [AndroidStudioEvent] with editor highlighting stats.
* Resets statistics so that counts are not double-counted in the next report.
*/
fun reportHighlightingStats() {
private fun reportHighlightingStats() {
val allStats = EditorHighlightingStats.newBuilder()
for ((fileType, recorder) in latencyRecorders) {
val histogram = recorder.intervalHistogram // Automatically resets statistics for this recorder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import kotlin.math.min
class DeviceArtScreenshotOptions(
override val serialNumber: String,
override val apiLevel: Int,
val deviceModel: String?
private val deviceModel: String?
) : ScreenshotAction.ScreenshotOptions {

override val screenshotViewerOptions: EnumSet<ScreenshotViewer.Option> = EnumSet.of(ALLOW_IMAGE_ROTATION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package com.android.tools.idea.adb.processnamemonitor
* @param addedProcesses A map (pid -> process name) of processes added on the devices
* @param removedProcesses A collection of processes removed from the device.
*/
internal class ClientMonitorEvent(val addedProcesses: Map<Int, ProcessNames>, val removedProcesses: Collection<Int>) {
internal class ClientMonitorEvent(private val addedProcesses: Map<Int, ProcessNames>, private val removedProcesses: Collection<Int>) {
override fun toString(): String {
val added = addedProcesses.entries.joinToString(prefix = "Added: [", postfix = "]") { "${it.key}->${it.value}" }
val removed = removedProcesses.joinToString(prefix = "Removed: [", postfix = "]") { it.toString() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class KotlinAndroidGradleModuleConfigurator : KotlinWithGradleConfigurator() {
collector.showNotification()
}

fun doConfigure(project: Project, modules: List<Module>, version: String): NotificationMessageCollector {
private fun doConfigure(project: Project, modules: List<Module>, version: String): NotificationMessageCollector {
return project.executeCommand(KotlinIdeaGradleBundle.message("command.name.configure.kotlin")) {
val collector = NotificationMessageCollector.create(project)
val changedFiles = configureWithVersion(project, modules, IdeKotlinVersion.get(version), collector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ class PsiModelClass(val type: PsiType, val mode: DataBindingMode) {
* Returns true if this is a wildcard type argument.
*/
// b/129719057 implement wildcard
val isWildcard = false
private val isWildcard = false

/**
* Returns true if this ModelClass represents a void
*/
val isVoid = PsiType.VOID.equalsToText(type.canonicalText)
private val isVoid = PsiType.VOID.equalsToText(type.canonicalText)

/**
* Returns true if this is a type variable. For example, in List&lt;T>, T is a type variable.
* However, List&lt;String>, String is not a type variable.
*/
// b/129719057 implement typeVar
val isTypeVar = false
private val isTypeVar = false

/**
* Returns true if this ModelClass or its type arguments contains any type variable or wildcard.
Expand All @@ -104,7 +104,7 @@ class PsiModelClass(val type: PsiType, val mode: DataBindingMode) {
* is List&lt;T>, then the return value will be a list containing T. null is returned
* if this is not a generic type
*/
val typeArguments: List<PsiModelClass>
private val typeArguments: List<PsiModelClass>
get() = (type as? PsiClassType)?.parameters
?.map { typeParameter -> PsiModelClass(typeParameter, mode) }
?: listOf()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PsiModelMethod(override val containingClass: PsiModelClass, val psiMethod:
/**
* Returns true if the final parameter is a varargs parameter.
*/
val isVarArgs = psiMethod.isVarArgs
private val isVarArgs = psiMethod.isVarArgs

/**
* @param args The arguments to the method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.jetbrains.kotlin.psi.KtPsiFactory
* Removes an obsolete if-SDK_INT check. This is only handling Kotlin code since for Java
* we reuse the builtin SimplifyBooleanExpressionFix check.
*/
class RemoveSdkCheckFix(var removeThen: Boolean) : DefaultLintQuickFix(
class RemoveSdkCheckFix(private var removeThen: Boolean) : DefaultLintQuickFix(
"Remove obsolete SDK version check",
"Remove obsolete SDK version checks"
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ data class NewAndroidComponentAction @JvmOverloads constructor(
minSdkApi: Int
): this(Category.values().find { it.name == category }!!, templateName, minSdkApi)

var shouldOpenFiles = true
private var shouldOpenFiles = true

private val isActivityTemplate: Boolean
get() = NEW_WIZARD_CATEGORIES.contains(category)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class NewAndroidFragmentAction
AndroidBundle.message("android.wizard.new.fragment.title"),
null) {

var shouldOpenFiles = true
private var shouldOpenFiles = true

init {
templatePresentation.icon = StudioIcons.Shell.Filetree.ANDROID_FILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ abstract class ConfigureModuleStep<ModuleModelKind : ModuleModel>(
FormScalingUtil.scaleComponentTree(this@ConfigureModuleStep.javaClass, this)
}
}
protected val rootPanel: JScrollPane by lazy {
private val rootPanel: JScrollPane by lazy {
wrapWithVScroll(validatorPanel, SMALL)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ class ModuleTemplateDataBuilder(
val isNewModule: Boolean,
private val viewBindingSupport: ViewBindingSupport
) {
var srcDir: File? = null
var resDir: File? = null
var manifestDir: File? = null
var testDir: File? = null
var unitTestDir: File? = null
var aidlDir: File? = null
private var srcDir: File? = null
private var resDir: File? = null
private var manifestDir: File? = null
private var testDir: File? = null
private var unitTestDir: File? = null
private var aidlDir: File? = null
var rootDir: File? = null
var name: String? = null
var isLibrary: Boolean? = null
var packageName: PackageName? = null
var formFactor: FormFactor? = null
var themesData: ThemesData? = null
var baseFeature: BaseFeature? = null
private var baseFeature: BaseFeature? = null
var apis: ApiTemplateData? = null
var category: Category? = null
var isMaterial3: Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const val DEFAULT_KOTLIN_VERSION = "1.4.31"
class ProjectTemplateDataBuilder(val isNewProject: Boolean) {
var androidXSupport: Boolean? = null
var gradlePluginVersion: GradleVersion? = null
var sdkDir: File? = null
private var sdkDir: File? = null
var language: Language? = null
var kotlinVersion: String? = null
var buildToolsVersion: Revision? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ class InferAnnotations(val settings: InferAnnotationsSettings, val project: Proj
}
}

val signatureSorter = Comparator<String> { o1, o2 ->
private val signatureSorter = Comparator<String> { o1, o2 ->
// Sort outer classes higher than inner classes; this means that "}" beats other characters
val l1 = o1.length
val l2 = o2.length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class InferredConstraints private constructor(
* Returns a list of all annotations; if [namesOnly] it will only use
* simple names
*/
fun getAllAnnotations(namesOnly: Boolean): List<String> {
private fun getAllAnnotations(namesOnly: Boolean): List<String> {
return getAnnotations(annotations, namesOnly)
}

Expand Down Expand Up @@ -475,7 +475,7 @@ class InferredConstraints private constructor(
* incompatible or implicit other annotations such as `@StringRes` or
* `@DimenRes`.
*/
fun clearResourceTypes() {
private fun clearResourceTypes() {
if (ignore) {
return
}
Expand Down Expand Up @@ -1368,7 +1368,7 @@ class InferredConstraints private constructor(
* A map from qualified annotation name back to the corresponding index in
* the [annotationNames] array
*/
val annotationToIndex: MutableMap<String, Int> = mutableMapOf()
private val annotationToIndex: MutableMap<String, Int> = mutableMapOf()

private fun isResourceAnnotation(qualifiedName: String): Boolean {
val index = annotationToIndex[qualifiedName] ?: return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.android.tools.idea.diagnostics

class TruncatingStringBuilder(val maxSize: Int, val truncationMessage: String) {
class TruncatingStringBuilder(private val maxSize: Int, private val truncationMessage: String) {
private val stringBuilder = StringBuilder()
private var hasHitLimit = false
private var size = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class HProfAnalysis(private val hprofFileChannel: FileChannel,
return tempChannel
}

val fileBackedListProvider = object: ListProvider {
private val fileBackedListProvider = object: ListProvider {
override fun createUByteList(name: String, size: Long) = FileBackedUByteList.createEmpty(openTempEmptyFileChannel(name), size)
override fun createUShortList(name: String, size: Long) = FileBackedUShortList.createEmpty(openTempEmptyFileChannel(name), size)
override fun createIntList(name: String, size: Long) = FileBackedIntList.createEmpty(openTempEmptyFileChannel(name), size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ open class HProfVisitor {
return myHeapDumpVisits[type.value]
}

fun enableAll() {
private fun enableAll() {
for (recordType in RecordType.values()) {
myTopLevelVisits[recordType.value] = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FileChannelBackedWriteBuffer(
position += 4
}

fun writeShort(value: Short) {
private fun writeShort(value: Short) {
if (tempBuf.remaining() < 2) {
flushBuffer()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class HProfReadBuffer : AutoCloseable {
}
}

fun getUnsignedByte(): Int = java.lang.Byte.toUnsignedInt(get())
private fun getUnsignedByte(): Int = java.lang.Byte.toUnsignedInt(get())
fun getUnsignedShort(): Int = java.lang.Short.toUnsignedInt(getShort())
fun getUnsignedInt(): Long = java.lang.Integer.toUnsignedLong(getInt())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object HeapReportUtils {
private val SI_PREFIXES = charArrayOf('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') // Kilo, Mega, Giga, Peta, etc.
const val STRING_PADDING_FOR_COUNT = 5
const val STRING_PADDING_FOR_SIZE = STRING_PADDING_FOR_COUNT + 1
const val SECTION_HEADER_SIZE = 50
private const val SECTION_HEADER_SIZE = 50

fun toShortStringAsCount(count: Long): String {
return toShortString(count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ data class EditStatus(val editState: EditState, val message: String)
* Allows any component to listen to all method body edits of a project.
*/
@Service
class LiveEditService private constructor(project: Project, var listenerExecutor: Executor) : Disposable {
class LiveEditService private constructor(project: Project, private var listenerExecutor: Executor) : Disposable {

val inlineCandidateCache = SourceInlineCandidateCache()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ interface LiveLiteralsMonitorHandler {
@Service
class LiveLiteralsService private constructor(private val project: Project,
listenerExecutor: Executor,
val deploymentReportService: LiveLiteralsDeploymentReportService) : LiveLiteralsMonitorHandler, Disposable {
private val deploymentReportService: LiveLiteralsDeploymentReportService) : LiveLiteralsMonitorHandler, Disposable {
init {
deploymentReportService.subscribe(this@LiveLiteralsService, object : LiveLiteralsDeploymentReportService.Listener {
override fun onMonitorStarted(deviceId: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ToggleLiveLiteralsHighlightAction : AnAction(message("live.literals.highli
}

companion object {
fun getShortcutLabel(): String {
private fun getShortcutLabel(): String {
val highlightAction = ActionManager.getInstance().getAction("Compose.Live.Literals.ToggleHighlight")
return highlightAction.shortcutSet.shortcuts.firstOrNull()?.let {
" (${KeymapUtil.getShortcutText(it)})"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import java.nio.file.Paths
import javax.swing.JList
import javax.swing.JPanel

class AndroidGradleProjectSettingsControlBuilder(val myInitialSettings: GradleProjectSettings) : JavaGradleProjectSettingsControlBuilder(myInitialSettings) {
class AndroidGradleProjectSettingsControlBuilder(private val myInitialSettings: GradleProjectSettings) : JavaGradleProjectSettingsControlBuilder(myInitialSettings) {
companion object {
const val GRADLE_JDK_LABEL_TEXT = "Gradle JDK:"
const val EMBEDDED_JDK_NAME = "Embedded JDK"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ProjectDumper(
else this

fun String.replaceCurrentSdkVersion(): String = replace(SdkVersionInfo.HIGHEST_KNOWN_STABLE_API.toString(), "<SDK_VERSION>")
fun String.replaceCurrentBuildToolsVersion(): String = replace(SdkConstants.CURRENT_BUILD_TOOLS_VERSION.toString(), "<BUILD_TOOLS_VERSION>")
private fun String.replaceCurrentBuildToolsVersion(): String = replace(SdkConstants.CURRENT_BUILD_TOOLS_VERSION.toString(), "<BUILD_TOOLS_VERSION>")

fun String.replaceKnownPatterns(): String =
this
Expand Down Expand Up @@ -271,7 +271,7 @@ class ProjectDumper(
this.currentRootDirectoryName = savedRootName
}

fun String.removeAndroidVersionsFromPath(): String =
private fun String.removeAndroidVersionsFromPath(): String =
androidPathPattern.find(this)?.groups?.get(1)?.let {
this.replace(it.value, "<VERSION>")
} ?: this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class RepositoryUrlManager @NonInjectable @VisibleForTesting constructor(
* @param filter the optional filter constraining acceptable versions
* @param includePreviews whether to include preview versions of libraries
*/
fun findVersion(
private fun findVersion(
groupId: String, artifactId: String, filter: Predicate<GradleVersion>?, includePreviews: Boolean, fileSystem: FileSystem
): GradleVersion? {
val version: GradleVersion?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.intellij.openapi.module.Module
import org.w3c.dom.Document

internal sealed class MergedManifestException(
val mergedManifestInfo: MergedManifestInfo?,
private val mergedManifestInfo: MergedManifestInfo?,
message: String,
cause: Throwable? = null
) : RuntimeException(mergedManifestInfo?.errorMessage(message) ?: message, cause) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PseudoClass private constructor(val name: String,
val superName: String,
val isInterface: Boolean,
val interfaces: List<String>,
val classLocator: PseudoClassLocator) {
private val classLocator: PseudoClassLocator) {
private fun locateClass(fqn: String): PseudoClass =
if (fqn == JAVA_OBJECT_FQN)
objectPseudoClass()
Expand All @@ -81,7 +81,7 @@ class PseudoClass private constructor(val name: String,
/**
* Returns whether this type is a subclass of [pseudoClass].
*/
fun isSubclassOf(pseudoClass: PseudoClass): Boolean {
private fun isSubclassOf(pseudoClass: PseudoClass): Boolean {
if (this == pseudoClass) return true
// Object is not a subclass of anything
if (this == objectPseudoClass) return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ open class HasLiveLiteralsTransform @JvmOverloads constructor(
override val uniqueId: String = "${HasLiveLiteralsTransform::class.qualifiedName!!},$fileInfoAnnotationName"

private var className = ""
var hasLiveLiterals = false
private var hasLiveLiterals = false
private set

override fun visitAnnotation(descriptor: String?, visible: Boolean): AnnotationVisitor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit
*/
class CachingLoader constructor(
private val delegate: DelegatingClassLoader.Loader,
val cacheBuilder: CacheBuilder<String, ByteArray>) : DelegatingClassLoader.Loader {
private val cacheBuilder: CacheBuilder<String, ByteArray>) : DelegatingClassLoader.Loader {

constructor(delegate: DelegatingClassLoader.Loader,
expireAfterWriteMs: Long = DEFAULT_EXPIRE_AFTER_WRITE_MS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ import java.util.concurrent.Executor
* should not be created if it doesn't exist or is out of date.
*/
class ResourceFolderRepositoryCachingData(val cacheFile: Path,
val cacheIsInvalidated: Boolean,
private val cacheIsInvalidated: Boolean,
val codeVersion: String,
val cacheCreationExecutor: Executor? = null)
2 changes: 1 addition & 1 deletion android/src/com/android/tools/idea/res/StateList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class StateListState(var value: String?, val attributes: Map<String, Boolean>, v
/**
* @return a list of all the attribute names. Names are capitalized is capitalize is true
*/
fun getAttributesNames(capitalize: Boolean): ImmutableList<String> {
private fun getAttributesNames(capitalize: Boolean): ImmutableList<String> {
val attributes = attributes

if (attributes.isEmpty()) {
Expand Down
Loading

0 comments on commit 48de473

Please sign in to comment.