IJPL-162560: IncorrectProcessCanceledExceptionHandlingInspection: Rename to IncorrectCancellationExceptionHandlingInspection

GitOrigin-RevId: cfad09299a8124eea5747dd36d5472ae27e3c9ab
This commit is contained in:
Karol Lewandowski
2024-09-20 09:04:28 +02:00
committed by intellij-monorepo-bot
parent cb6b9a9a0c
commit 0f2f3780b5
17 changed files with 18 additions and 18 deletions

View File

@@ -443,7 +443,7 @@
projectType="INTELLIJ_PLUGIN"
groupPathKey="inspections.group.path" groupKey="inspections.group.code"
enabledByDefault="false" level="ERROR"
implementationClass="org.jetbrains.idea.devkit.inspections.IncorrectProcessCanceledExceptionHandlingInspection"
implementationClass="org.jetbrains.idea.devkit.inspections.IncorrectCancellationExceptionHandlingInspection"
key="inspections.incorrect.cancellation.exception.handling.display.name"/>
<localInspection language="UAST" shortName="StaticInitializationInExtensions" groupPathKey="inspections.group.path"

View File

@@ -23,7 +23,7 @@ import org.jetbrains.uast.visitor.AbstractUastVisitor
// "CE" stands for "cancellation exception", without a specific type meaning
private val ceClassNames = listOf("com.intellij.openapi.progress.ProcessCanceledException")
internal class IncorrectProcessCanceledExceptionHandlingInspection : DevKitUastInspectionBase() {
internal class IncorrectCancellationExceptionHandlingInspection : DevKitUastInspectionBase() {
override fun buildInternalVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
return create(holder.file.language, object : AbstractUastNonRecursiveVisitor() {

View File

@@ -30,7 +30,7 @@ public class DevkitInspectionsRegistrationCheckTest extends BasePlatformTestCase
"CancellationCheckInLoops",
"ThreadingConcurrency",
"CallingMethodShouldBeRequiresBlockingContext",
"IncorrectProcessCanceledExceptionHandling",
"IncorrectCancellationExceptionHandling",
"PotentialDeadlockInServiceInitialization"
).sorted().toList();

View File

@@ -1,11 +1,11 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.inspections
import com.intellij.testFramework.TestDataPath
import org.jetbrains.idea.devkit.DevkitJavaTestsUtil
@TestDataPath("\$CONTENT_ROOT/testData/inspections/incorrectPceHandling")
class IncorrectProcessCanceledExceptionHandlingInspectionTest : IncorrectProcessCanceledExceptionHandlingInspectionTestBase() {
@TestDataPath("/inspections/incorrectCeHandling")
class IncorrectCancellationExceptionHandlingInspectionTest : IncorrectCancellationExceptionHandlingInspectionTestBase() {
override fun setUp() {
super.setUp()
@@ -28,7 +28,7 @@ class IncorrectProcessCanceledExceptionHandlingInspectionTest : IncorrectProcess
doTest()
}
override fun getBasePath() = DevkitJavaTestsUtil.TESTDATA_PATH + "inspections/incorrectPceHandling"
override fun getBasePath() = DevkitJavaTestsUtil.TESTDATA_PATH + "inspections/incorrectCeHandling"
override fun getFileExtension() = "java"

View File

@@ -3,10 +3,10 @@ package org.jetbrains.idea.devkit.kotlin.inspections
import com.intellij.testFramework.TestDataPath
import org.intellij.lang.annotations.Language
import org.jetbrains.idea.devkit.inspections.IncorrectProcessCanceledExceptionHandlingInspectionTestBase
import org.jetbrains.idea.devkit.inspections.IncorrectCancellationExceptionHandlingInspectionTestBase
import org.jetbrains.idea.devkit.kotlin.DevkitKtTestsUtil
abstract class KtIncorrectProcessCanceledExceptionHandlingInspectionTestBase : IncorrectProcessCanceledExceptionHandlingInspectionTestBase() {
abstract class KtIncorrectCancellationExceptionHandlingInspectionTestBase : IncorrectCancellationExceptionHandlingInspectionTestBase() {
override fun setUp() {
super.setUp()
@@ -35,14 +35,14 @@ abstract class KtIncorrectProcessCanceledExceptionHandlingInspectionTestBase : I
myFixture.addFileToProject(relativePath, fileText)
}
override fun getBasePath() = DevkitKtTestsUtil.TESTDATA_PATH + "inspections/incorrectPceHandling"
override fun getBasePath() = DevkitKtTestsUtil.TESTDATA_PATH + "inspections/incorrectCeHandling"
override fun getFileExtension() = "kt"
}
@TestDataPath("\$CONTENT_ROOT/testData/inspections/incorrectPceHandling")
class KtIncorrectProcessCanceledExceptionHandlingInspectionTest : KtIncorrectProcessCanceledExceptionHandlingInspectionTestBase() {
@TestDataPath("/inspections/incorrectCeHandling")
class KtIncorrectProcessCanceledExceptionHandlingInspectionTest : KtIncorrectCancellationExceptionHandlingInspectionTestBase() {
fun testIncorrectPceHandlingTests() {
doTest()
@@ -58,8 +58,8 @@ class KtIncorrectProcessCanceledExceptionHandlingInspectionTest : KtIncorrectPro
}
@TestDataPath("\$CONTENT_ROOT/testData/inspections/incorrectPceHandling")
class KtIncorrectCancellationExceptionHandlingInspectionTest : KtIncorrectProcessCanceledExceptionHandlingInspectionTestBase() {
@TestDataPath("/inspections/incorrectCeHandling")
class KtIncorrectCancellationExceptionHandlingInspectionTest : KtIncorrectCancellationExceptionHandlingInspectionTestBase() {
private val USE_K2_KEY = "idea.kotlin.plugin.use.k2"
private var previousK2Property: String? = null
@@ -120,7 +120,7 @@ class KtIncorrectCancellationExceptionHandlingInspectionTest : KtIncorrectProces
}
// TODO: disabled - for some reason @Throws cannot be resolved in test data
/*fun testIncorrectCeHandlingWhenPceCaughtImplicitlyTests() {
/*fun testIncorrectCeHandlingWhenCeCaughtImplicitlyTests() {
doTest()
}*/

View File

@@ -1,13 +1,13 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.inspections
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
abstract class IncorrectProcessCanceledExceptionHandlingInspectionTestBase : LightJavaCodeInsightFixtureTestCase() {
abstract class IncorrectCancellationExceptionHandlingInspectionTestBase : LightJavaCodeInsightFixtureTestCase() {
override fun setUp() {
super.setUp()
myFixture.enableInspections(IncorrectProcessCanceledExceptionHandlingInspection())
myFixture.enableInspections(IncorrectCancellationExceptionHandlingInspection())
myFixture.addClass("""
package com.intellij.openapi.progress;
public class ProcessCanceledException extends RuntimeException {}