mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
IJPL-162560: IncorrectProcessCanceledExceptionHandlingInspection: Add support for CancellationException in coroutine context
GitOrigin-RevId: aeaa49f2a8e27af62a3ec826b3cece3a4e0c447b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
132168dac4
commit
cb6b9a9a0c
@@ -8,7 +8,7 @@ class IncorrectPceHandlingTests {
|
||||
void testPceSwallowed() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
// exception swallowed
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class IncorrectPceHandlingTests {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException e) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -25,64 +25,64 @@ class IncorrectPceHandlingTests {
|
||||
void testSwallowedAndLoggedWithMessageOnInfoLevel() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.info("Error occured", e)</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.info("Error occured", e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testSwallowedAndLoggedOnInfoLevel() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.info(e)</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.info(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testSwallowedAndLoggedOnErrorLevel() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testSwallowedAndOnlyExceptionMessageLogged() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testDisjunctionTypesWhenPceIsFirst() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException | IllegalStateException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (ProcessCanceledException | IllegalStateException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testDisjunctionTypesWhenPceIsSecond() {
|
||||
try {
|
||||
// anything
|
||||
} catch (IllegalStateException | ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (IllegalStateException | ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testPceInheritorSwallowedAndLogger() {
|
||||
try {
|
||||
// anything
|
||||
} catch (SubclassOfProcessCanceledException <error descr="'ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
} catch (SubclassOfProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testPceInheritorSwallowedAndLoggerWhenDisjunctionTypeDefined() {
|
||||
try {
|
||||
// anything
|
||||
} catch (IllegalStateException | SubclassOfProcessCanceledException <error descr="'ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
} catch (IllegalStateException | SubclassOfProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
void testPceSwallowed() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
// exception swallowed
|
||||
} catch (Exception e) {
|
||||
// exception swallowed
|
||||
@@ -19,7 +19,7 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException e) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// exception swallowed
|
||||
@@ -29,8 +29,8 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
void testSwallowedAndLoggedWithMessageOnInfoLevel() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.info("Error occured", e)</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.info("Error occured", e)</error>;
|
||||
} catch (Exception e) {
|
||||
LOG.info("Error occured", e);
|
||||
}
|
||||
@@ -39,8 +39,8 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
void testSwallowedAndLoggedOnInfoLevel() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.info(e)</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.info(e)</error>;
|
||||
} catch (Exception e) {
|
||||
LOG.info(e);
|
||||
}
|
||||
@@ -49,8 +49,8 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
void testSwallowedAndLoggedOnErrorLevel() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
@@ -59,8 +59,8 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
void testSwallowedAndOnlyExceptionMessageLogged() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error occurred: " + e.getMessage());
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
void testPceSwallowedAndMultipleGenericCatchClauses() {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
// exception swallowed
|
||||
} catch (RuntimeException e) {
|
||||
// exception swallowed
|
||||
@@ -84,7 +84,7 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
try {
|
||||
// anything
|
||||
} catch (ProcessCanceledException e) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
throw e;
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error(e);
|
||||
@@ -98,9 +98,9 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
void testPceInheritorSwallowedAndMultipleGenericCatchClauses() {
|
||||
try {
|
||||
// anything
|
||||
} catch (SubclassOfProcessCanceledException <error descr="'ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
} catch (SubclassOfProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
// exception swallowed
|
||||
} catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
} catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
// exception swallowed
|
||||
} catch (RuntimeException e) {
|
||||
// exception swallowed
|
||||
@@ -115,10 +115,10 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
try {
|
||||
// anything
|
||||
} catch (SubclassOfProcessCanceledException e) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
throw e;
|
||||
} catch (ProcessCanceledException e) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
throw e;
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error(e);
|
||||
@@ -135,8 +135,8 @@ class IncorrectPceHandlingWhenMultipleCatchClausesTests {
|
||||
try {
|
||||
// anything
|
||||
}
|
||||
catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
|
||||
@@ -14,7 +14,7 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
void testPceSwallowed() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
// exception swallowed
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (Exception e) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.error(e)</error>;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -31,55 +31,55 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
void testSwallowedAndLoggedWithMessageOnInfoLevel() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.info("Error occured", e)</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.info("Error occured", e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testSwallowedAndLoggedOnInfoLevel() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.info(e)</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.info(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testSwallowedAndLoggedOnErrorLevel() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.error(e)</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testSwallowedAndOnlyExceptionMessageLogged() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testDisjunctionTypesWhenPceIsFirst() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (RuntimeException | Error <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (RuntimeException | Error <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testDisjunctionTypesWhenPceIsSecond() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (Error | RuntimeException <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (Error | RuntimeException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testPceSwallowedAndMultipleGenericCatchClauses() {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (RuntimeException <error descr="'ProcessCanceledException' must be rethrown. 'ProcessCanceledException' is thrown by 'throwPce()'.">e</error>) {
|
||||
} catch (RuntimeException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown. It is thrown by 'throwPce()'.">e</error>) {
|
||||
// exception swallowed
|
||||
} catch (Exception e) {
|
||||
// exception swallowed
|
||||
@@ -92,7 +92,7 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
try {
|
||||
throwPce();
|
||||
} catch (RuntimeException e) {
|
||||
<error descr="'ProcessCanceledException' must not be logged. 'ProcessCanceledException' is thrown by 'throwPce()'.">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged. It is thrown by 'throwPce()'.">LOG.error(e)</error>;
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
@@ -109,8 +109,8 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
try {
|
||||
throwPce();
|
||||
}
|
||||
catch (ProcessCanceledException <error descr="'ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
catch (ProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' must not be logged">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
@@ -129,7 +129,7 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
void testPceInheritorSwallowed() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
// exception swallowed
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (Exception e) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.error(e)</error>;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -146,55 +146,55 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
void testPceInheritorSwallowedAndLoggedWithMessageOnInfoLevel() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.info("Error occured", e)</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.info("Error occured", e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testPceInheritorSwallowedAndLoggedOnInfoLevel() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.info(e)</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.info(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testPceInheritorSwallowedAndLoggedOnErrorLevel() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.error(e)</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testPceInheritorSwallowedAndOnlyExceptionMessageLogged() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (Exception <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (Exception <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testDisjunctionTypesWhenPceInheritorIsFirst() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (RuntimeException | Error <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (RuntimeException | Error <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testDisjunctionTypesWhenPceInheritorIsSecond() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (Error | RuntimeException <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
} catch (Error | RuntimeException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.error("Error occurred: " + e.getMessage())</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void testPceInheritorSwallowedAndMultipleGenericCatchClauses() {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (RuntimeException <error descr="'ProcessCanceledException' inheritor must be rethrown. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
} catch (RuntimeException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown. It is thrown by 'throwPceInheritor()'.">e</error>) {
|
||||
// exception swallowed
|
||||
} catch (Exception e) {
|
||||
// exception swallowed
|
||||
@@ -207,7 +207,7 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
} catch (RuntimeException e) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged. 'ProcessCanceledException' is thrown by 'throwPceInheritor()'.">LOG.error(e)</error>;
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged. It is thrown by 'throwPceInheritor()'.">LOG.error(e)</error>;
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
@@ -224,8 +224,8 @@ class IncorrectPceHandlingWhenPceCaughtImplicitlyTests {
|
||||
try {
|
||||
throwPceInheritor();
|
||||
}
|
||||
catch (SubclassOfProcessCanceledException <error descr="'ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
<error descr="'ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
catch (SubclassOfProcessCanceledException <error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must be rethrown">e</error>) {
|
||||
<error descr="'com.intellij.openapi.progress.ProcessCanceledException' inheritor must not be logged">LOG.error(e)</error>;
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
|
||||
Reference in New Issue
Block a user