IJPL-212791 IJ-MR-179029 cleanup - visibility

GitOrigin-RevId: a3fa342c859fd2ad6e2d122d8d6b53619282d5e8
This commit is contained in:
Vladimir Krivosheev
2025-10-18 11:55:25 +00:00
committed by intellij-monorepo-bot
parent 786ca24342
commit a343835a94
6 changed files with 21 additions and 15 deletions
@@ -18,6 +18,7 @@ import com.intellij.openapi.ui.Messages
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.NioFiles
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VfsUtilCore
@@ -25,8 +26,9 @@ import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.toNioPathOrNull
import com.intellij.ui.UIBundle
import com.intellij.util.EnvironmentUtil
import com.intellij.util.io.delete
import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.intellij.images.ImagesBundle
import org.intellij.images.fileTypes.ImageFileTypeManager
import org.intellij.images.options.impl.ImagesConfigurable
@@ -157,9 +159,9 @@ private fun VirtualFile.copyToBackingFile(disposable: Disposable): VirtualFile {
private fun Path.safeDelete() {
try {
delete()
NioFiles.deleteRecursively(this)
}
catch (ignore: IOException) {
catch (_: IOException) {
}
}
@@ -4,14 +4,17 @@ package com.intellij.util.download.impl.eel
import com.intellij.ide.IdeCoreBundle
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.progress.*
import com.intellij.openapi.progress.EmptyProgressIndicator
import com.intellij.openapi.progress.ProcessCanceledException
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.io.NioFiles
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.*
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.util.concurrency.AppExecutorUtil
import com.intellij.util.download.DownloadableFileDescription
import com.intellij.util.download.eel.EelFileDownloader
import com.intellij.util.io.HttpRequests
import com.intellij.util.io.delete
import com.intellij.util.progress.ConcurrentTasksProgressManager
import org.jetbrains.annotations.ApiStatus
import java.io.IOException
@@ -155,7 +158,7 @@ internal class EelFileDownloaderImpl(
}
}
private fun deleteFiles(pairs: List<Pair<Path, DownloadableFileDescription>>) = pairs.forEach { it.first.delete() }
private fun deleteFiles(pairs: List<Pair<Path, DownloadableFileDescription>>) = pairs.forEach { NioFiles.deleteRecursively(it.first) }
@Throws(IOException::class)
private fun downloadFile(
@@ -74,7 +74,7 @@ private class LocalSettingsController : DelegatedSettingsController {
return internalOperation(storageManager.value.internalMap, componentName)
}
is PersistenceStateComponentPropertyTag -> {
// this tag is expected to be first
// this tag is expected to be the first
componentName = tag.componentName
}
}
@@ -2,6 +2,7 @@
package com.intellij.util.io.impl
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.CharsetToolkit
import com.intellij.platform.testFramework.core.FileComparisonFailedError
@@ -55,7 +56,7 @@ sealed class DirectorySpecBase(override val originalFile: Path?) : DirectoryCont
}
override fun generateInTempDir(): Path {
val target = FileUtil.createTempDirectory("directory-by-spec", null, true).toPath()
val target = FileUtilRt.createTempDirectory("directory-by-spec", null, true).toPath()
generate(target)
return target
}
@@ -224,7 +225,7 @@ private fun assertDirectoryContentMatches(file: Path,
val dirForExtracted = FileUtil.createTempDirectory("extracted-${file.name}", null, false).toPath()
ZipUtil.extract(file, dirForExtracted, null)
assertDirectoryMatches(dirForExtracted, spec, relativePath, fileTextMatcher, filePathFilter, errorReporter, expectedDataIsInSpec)
FileUtil.delete(dirForExtracted)
FileUtilRt.deleteRecursively(dirForExtracted)
}
is FileSpec -> {
errorReporter.assertTrue(relativePath, "$file is not a file", file.isRegularFile())
@@ -314,7 +315,7 @@ private fun createSpecByPath(path: Path, originalFile: Path?): DirectoryContentS
ZipUtil.extract(path, dirForExtracted, null)
val spec = if (path.extension == "jar") JarSpec() else ZipSpec()
fillSpecFromDirectory(spec, dirForExtracted, null)
FileUtil.delete(dirForExtracted)
FileUtilRt.deleteRecursively(dirForExtracted)
return spec
}
return FileSpec(Files.readAllBytes(path), originalFile)
@@ -10,7 +10,7 @@ import org.jetbrains.kotlin.idea.codeInsight.inspections.shared.ReplaceUntilWith
import org.jetbrains.kotlin.tools.projectWizard.core.service.InspectionWizardService
import org.jetbrains.kotlin.tools.projectWizard.wizard.service.IdeaWizardService
class IdeaInspectionsWizardService(private val project: Project) : InspectionWizardService, IdeaWizardService {
private class IdeaInspectionsWizardService(private val project: Project) : InspectionWizardService, IdeaWizardService {
override fun changeInspectionSettings() {
val projectProfile = ProjectInspectionProfileManager.getInstance(project).projectProfile
val key = HighlightDisplayKey.find(ReplaceUntilWithRangeUntilInspection().shortName)
@@ -6,9 +6,9 @@ import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.NioFiles
import com.intellij.terminal.JBTerminalWidget
import com.intellij.terminal.pty.PtyProcessTtyConnector
import com.intellij.util.io.delete
import com.jediterm.core.util.TermSize
import com.pty4j.windows.conpty.WinConPtyProcess
import org.jetbrains.annotations.ApiStatus
@@ -80,7 +80,7 @@ class ClassicTerminalTestShellSession(shellCommand: List<String>?, val widget: S
catch (t: Throwable) {
logger<ClassicTerminalTestShellSession>().error("Error closing TtyConnector", t)
}
workingDirectory.delete()
NioFiles.deleteRecursively(workingDirectory)
}
if (SystemInfo.isWindows) {