[project] dropping obsolete 'BlockingMethodInNonBlockingContext' suppressions

(the profile was tuned so that unknown contexts aren't trigger warnings anymore)

GitOrigin-RevId: a5ca7553094c4defbc96ef8d26d9dcd51eb71935
This commit is contained in:
Roman Shevchenko
2023-02-10 19:35:59 +01:00
committed by intellij-monorepo-bot
parent 4568142720
commit 451c7f141e
30 changed files with 51 additions and 85 deletions

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext", "ReplacePutWithAssignment", "ReplaceGetOrSet")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplacePutWithAssignment", "ReplaceGetOrSet")
package org.jetbrains.intellij.build.io
@@ -290,4 +290,4 @@ internal suspend fun dumpThreads(pid: Long) {
?.let { "$it/bin/jstack" }
?: "jstack"
runProcess(args = listOf(jstack, pid.toString()), inheritOut = true)
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet")
package org.jetbrains.intellij.build.tasks
@@ -213,4 +213,4 @@ fun reorderJar(jarFile: Path, orderedNames: List<String>, resultJarFile: Path):
Files.deleteIfExists(tempJarFile)
}
return PackageIndexEntry(path = resultJarFile, packageIndexBuilder.classPackageHashSet, packageIndexBuilder.resourcePackageHashSet)
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "ReplacePutWithAssignment", "BlockingMethodInNonBlockingContext", "ReplaceNegatedIsEmptyWithIsNotEmpty")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "ReplacePutWithAssignment", "ReplaceNegatedIsEmptyWithIsNotEmpty")
package org.jetbrains.intellij.build.devServer
import com.intellij.diagnostic.telemetry.useWithScope
@@ -381,4 +381,4 @@ private fun createBuildOptions(runDir: Path): BuildOptions {
options.outputRootPath = runDir
options.buildStepsToSkip.add(BuildOptions.PREBUILD_SHARED_INDEXES)
return options
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext", "PrivatePropertyName")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("PrivatePropertyName")
package org.jetbrains.intellij.build.devServer
@@ -174,4 +174,4 @@ private fun isCacheUpToDate(plugin: PluginBuildDescriptor, projectOutDir: Path):
}
}
return null
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext", "ReplaceGetOrSet")
@file:Suppress("ReplaceGetOrSet")
package org.jetbrains.intellij.build
import io.ktor.client.HttpClient
@@ -297,7 +297,6 @@ suspend fun downloadFileToCacheLocation(url: String, communityRoot: BuildDepende
fun CoroutineScope.readChannel(file: Path): ByteReadChannel {
return writer(CoroutineName("file-reader") + Dispatchers.IO, autoFlush = false) {
@Suppress("BlockingMethodInNonBlockingContext")
FileChannel.open(file, StandardOpenOption.READ).use { fileChannel ->
@Suppress("DEPRECATION")
channel.writeSuspendSession {

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "BlockingMethodInNonBlockingContext")
@file:Suppress("ReplaceGetOrSet")
@file:OptIn(ExperimentalCoroutinesApi::class)
package org.jetbrains.intellij.build.images
@@ -480,4 +480,4 @@ private class Stores(classifier: String, dbDir: Path) {
s2.file?.let { list.add(it) }
s2_5.file?.let { list.add(it) }
}
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceJavaStaticMethodWithKotlinAnalog", "BlockingMethodInNonBlockingContext")
@file:Suppress("ReplaceJavaStaticMethodWithKotlinAnalog")
package org.jetbrains.intellij.build

View File

@@ -1,7 +1,5 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplacePutWithAssignment", "ReplaceNegatedIsEmptyWithIsNotEmpty", "LiftReturnOrAssignment",
"BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplacePutWithAssignment", "ReplaceNegatedIsEmptyWithIsNotEmpty", "LiftReturnOrAssignment")
package org.jetbrains.intellij.build.impl
import com.intellij.diagnostic.telemetry.useWithScope

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.impl
import com.intellij.diagnostic.telemetry.use

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.impl
import com.intellij.diagnostic.telemetry.useWithScope2
@@ -227,4 +225,4 @@ private data class Rule(@JvmField val path: String, @JvmField val version: Int)
@Volatile
@JvmField
var wasUsed = false
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "BlockingMethodInNonBlockingContext", "ReplaceNegatedIsEmptyWithIsNotEmpty", "PrivatePropertyName")
@file:Suppress("ReplaceGetOrSet", "ReplaceNegatedIsEmptyWithIsNotEmpty", "PrivatePropertyName")
package org.jetbrains.intellij.build.impl
@@ -1246,4 +1246,4 @@ private fun buildBlockMap(file: Path, json: JSON) {
json.write(FileHash(input, algorithm), output)
}
}
}
}

View File

@@ -1,7 +1,5 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "ReplacePutWithAssignment", "ReplaceJavaStaticMethodWithKotlinAnalog",
"BlockingMethodInNonBlockingContext")
@file:Suppress("ReplaceGetOrSet", "ReplacePutWithAssignment", "ReplaceJavaStaticMethodWithKotlinAnalog")
package org.jetbrains.intellij.build.impl
import com.intellij.diagnostic.telemetry.use
@@ -775,4 +773,4 @@ fun buildJar(targetFile: Path,
dryRun = dryRun,
compress = compress,
)
}
}

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.impl
import com.intellij.diagnostic.telemetry.useWithScope

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.impl
import com.intellij.openapi.util.SystemInfoRt
@@ -210,4 +208,4 @@ private suspend fun buildDmgLocally(sitFile: Path,
)
context.notifyArtifactBuilt(dmgFile)
}
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "BlockingMethodInNonBlockingContext", "ReplacePutWithAssignment", "ReplaceNegatedIsEmptyWithIsNotEmpty")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplaceGetOrSet", "ReplacePutWithAssignment", "ReplaceNegatedIsEmptyWithIsNotEmpty")
package org.jetbrains.intellij.build.impl
@@ -420,4 +420,4 @@ class PluginLayout private constructor(
interface VersionEvaluator {
fun evaluate(pluginXml: Path, ideBuildVersion: String, context: BuildContext): String
}
}
}

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.impl
import kotlinx.coroutines.CoroutineScope
@@ -74,4 +72,4 @@ private suspend fun runSvgTool(context: BuildContext, svgToolClasspath: List<Str
"SVG tool: after running SVG prebuild it must be a least one file at $dbDir"
}
}
}
}

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.impl
import com.intellij.diagnostic.telemetry.useWithScope2
@@ -241,7 +239,6 @@ internal class WindowsDistributionBuilder(
.enumerate()
.forEach { file ->
transformFile(file) { target ->
@Suppress("BlockingMethodInNonBlockingContext")
Files.writeString(target, toDosLineEndings(Files.readString(file)))
}
}

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.intellij.build.impl
@@ -114,4 +112,4 @@ private class WritableByteChannelBackedByByteBuffer(private val buffer: ByteBuff
}
return this
}
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.execution.process.mediator.daemon
import com.google.protobuf.ByteString
@@ -116,7 +116,6 @@ internal class ProcessManager : Closeable {
STDIN -> process.outputStream
else -> throw IllegalArgumentException("Unknown process input FD $fd for PID $handleId")
}
@Suppress("BlockingMethodInNonBlockingContext")
withContext(Dispatchers.IO) {
outputStream.use { outputStream ->
with(currentCoroutineContext()) {
@@ -167,7 +166,6 @@ internal class ProcessManager : Closeable {
synchronized(this) {
check(_process == null) { "Process has already been initialized" }
lifetimeJob.ensureActive()
@Suppress("BlockingMethodInNonBlockingContext")
_process = processBuilder.start()
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide
import com.intellij.diagnostic.VMOptions
@@ -164,7 +164,6 @@ private suspend fun checkRuntime() {
if (Files.isRegularFile(configFile)) {
switchAction = NotificationAction.createSimpleExpiring(IdeBundle.message("action.SwitchToJBR.text")) {
try {
@Suppress("BlockingMethodInNonBlockingContext")
Files.delete(configFile)
ApplicationManagerEx.getApplicationEx().restart(true)
}
@@ -194,7 +193,6 @@ private fun isModernJBR(): Boolean {
return jbrVersion == null || JavaVersion.current() >= jbrVersion.version
}
@Suppress("BlockingMethodInNonBlockingContext")
private suspend fun isJbrOperational(): Boolean {
val bin = Path.of(PathManager.getBundledRuntimePath(), if (SystemInfoRt.isWindows) "bin/java.exe" else "bin/java")
if (Files.isRegularFile(bin) && (SystemInfoRt.isWindows || Files.isExecutable(bin))) {

View File

@@ -608,7 +608,6 @@ object ProjectUtil {
return projectManager.openProjectAsync(existingFile, OpenProjectTask { runConfigurators = true })
}
@Suppress("BlockingMethodInNonBlockingContext")
val created = try {
withContext(Dispatchers.IO) {
!Files.exists(file) && Files.createDirectories(file) != null || Files.isDirectory(file)
@@ -758,4 +757,4 @@ fun <T> Project.computeOnPooledThread(task: Callable<T>): CompletableFuture<T> {
@Deprecated(message = "temporary solution for old code in java", level = DeprecationLevel.ERROR)
fun Project.executeOnPooledIoThread(task: Runnable) {
coroutineScope.launch(Dispatchers.IO) { task.run() }
}
}

View File

@@ -1,5 +1,5 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("ReplacePutWithAssignment", "BlockingMethodInNonBlockingContext")
@file:Suppress("ReplacePutWithAssignment")
package com.intellij.idea

View File

@@ -1,6 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
package com.intellij.platform
import com.intellij.ide.impl.OpenProjectTask
@@ -418,4 +416,4 @@ suspend fun attachToProjectAsync(projectToClose: Project, projectDir: Path, call
}
}
return false
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.application.impl
import com.intellij.openapi.Disposable
@@ -35,7 +35,6 @@ class ExpirableExecutorTest : LightPlatformTestCase() {
runBlocking {
val job = launch(context + CoroutineName("blabla")) {
@Suppress("BlockingMethodInNonBlockingContext")
startSignal.tryAcquire(10, TimeUnit.SECONDS)
this.ensureActive()
}
@@ -45,4 +44,4 @@ class ExpirableExecutorTest : LightPlatformTestCase() {
assertTrue(job.isCompleted && job.isCancelled)
}
}
}
}

View File

@@ -1,5 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@file:Suppress("BlockingMethodInNonBlockingContext")
package org.jetbrains.io
import com.intellij.openapi.Disposable

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.lang;
import org.jetbrains.annotations.ApiStatus;
@@ -25,7 +25,6 @@ import java.util.function.Function;
import java.util.function.Predicate;
import java.util.jar.Attributes;
@SuppressWarnings("BlockingMethodInNonBlockingContext")
@ApiStatus.Internal
public final class ClassPath {
public static final String CLASSPATH_JAR_FILE_NAME_PREFIX = "classpath";
@@ -648,4 +647,4 @@ public final class ClassPath {
return "Measurer(time=" + TimeUnit.NANOSECONDS.toMillis(timeCounter.get()) + "ms, requests=" + requestCounter + ')';
}
}
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.lang;
import org.jetbrains.annotations.NotNull;
@@ -24,7 +24,6 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.function.BiConsumer;
import java.util.function.Predicate;
@SuppressWarnings("BlockingMethodInNonBlockingContext")
final class FileLoader implements Loader {
private static final EnumSet<StandardOpenOption> READ_OPTIONS = EnumSet.of(StandardOpenOption.READ);
private static final EnumSet<StandardOpenOption> WRITE_OPTIONS = EnumSet.of(StandardOpenOption.WRITE, StandardOpenOption.CREATE);

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.lang;
import com.intellij.util.UrlUtilRt;
@@ -29,7 +29,6 @@ import java.util.function.Predicate;
* <p>
* This classloader implementation is separate from {@link PathClassLoader} because it's used in runtime modules with JDK 1.8.
*/
@SuppressWarnings("BlockingMethodInNonBlockingContext")
public class UrlClassLoader extends ClassLoader implements ClassPath.ClassDataConsumer {
private static final boolean isClassPathIndexEnabledGlobalValue = Boolean.parseBoolean(System.getProperty("idea.classpath.index.enabled", "true"));

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.python.packaging.cache
import com.intellij.openapi.application.ApplicationInfo
@@ -50,7 +50,6 @@ class PythonSimpleRepositoryCache : PythonPackageCache<PyPackageRepository> {
}
}
@Suppress("BlockingMethodInNonBlockingContext")
private suspend fun loadFrom(repository: PyPackageRepository): List<String> {
return withContext(Dispatchers.IO) {
val packages = mutableListOf<String>()
@@ -89,4 +88,4 @@ class PythonSimpleRepositoryCache : PythonPackageCache<PyPackageRepository> {
override fun isEmpty(): Boolean = cache.isEmpty()
override fun contains(key: PyPackageRepository): Boolean = key in cache
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.python.packaging.management
import com.intellij.openapi.application.ApplicationManager
@@ -33,11 +33,10 @@ class PythonPackagesUpdater : ProjectActivity {
}
}
@Suppress("BlockingMethodInNonBlockingContext")
private fun cacheExpired(path: Path): Boolean {
val fileTime = Files.getLastModifiedTime(path)
val expirationTime = fileTime.toInstant().plus(Duration.ofDays(1))
return expirationTime.isBefore(Instant.now())
}
}
}