aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-ce-task/src
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2023-01-09 10:21:46 +0100
committersonartech <sonartech@sonarsource.com>2023-01-10 20:03:01 +0000
commit295a87208f8c9898fbdc733a438587dc03a16877 (patch)
tree9771ee3245ab6e978b20b9d8b800450947fc7199 /server/sonar-ce-task/src
parent8868a5ff310c74f44f2c94e46ba31065017f50b4 (diff)
downloadsonarqube-295a87208f8c9898fbdc733a438587dc03a16877.tar.gz
sonarqube-295a87208f8c9898fbdc733a438587dc03a16877.zip
[NO-JIRA] Remove reported code smells about usage of instanceof
Diffstat (limited to 'server/sonar-ce-task/src')
-rw-r--r--server/sonar-ce-task/src/main/java/org/sonar/ce/task/CeTaskInterruptedException.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-ce-task/src/main/java/org/sonar/ce/task/CeTaskInterruptedException.java b/server/sonar-ce-task/src/main/java/org/sonar/ce/task/CeTaskInterruptedException.java
index 0c50abd1087..5ab9674b1e8 100644
--- a/server/sonar-ce-task/src/main/java/org/sonar/ce/task/CeTaskInterruptedException.java
+++ b/server/sonar-ce-task/src/main/java/org/sonar/ce/task/CeTaskInterruptedException.java
@@ -37,8 +37,8 @@ public abstract class CeTaskInterruptedException extends RuntimeException {
}
public static Optional<CeTaskInterruptedException> isTaskInterruptedException(Throwable e) {
- if (e instanceof CeTaskInterruptedException) {
- return Optional.of((CeTaskInterruptedException) e);
+ if (e instanceof CeTaskInterruptedException ceTaskInterruptedException) {
+ return Optional.of(ceTaskInterruptedException);
}
return isCauseInterruptedException(e);
}
@@ -48,8 +48,8 @@ public abstract class CeTaskInterruptedException extends RuntimeException {
if (cause == null || cause == e) {
return Optional.empty();
}
- if (cause instanceof CeTaskInterruptedException) {
- return Optional.of((CeTaskInterruptedException) cause);
+ if (cause instanceof CeTaskInterruptedException ceTaskInterruptedException) {
+ return Optional.of(ceTaskInterruptedException);
}
return isCauseInterruptedException(cause);
}