Skip to content

Commit 3e1725f

Browse files
committed
detekt
1 parent 594ecff commit 3e1725f

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/NotificationCustomDeserializers.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ class NotConditionDeserializer : JsonDeserializer<NotificationExpression.NotCond
116116

117117
// Create a custom deserializer if needed
118118
class NotificationTypeDeserializer : JsonDeserializer<NotificationScheduleType>() {
119-
override fun deserialize(p: JsonParser, ctxt: DeserializationContext): NotificationScheduleType {
120-
return NotificationScheduleType.fromString(p.valueAsString)
121-
}
119+
override fun deserialize(p: JsonParser, ctxt: DeserializationContext): NotificationScheduleType =
120+
NotificationScheduleType.fromString(p.valueAsString)
122121
}
123122

124123
private fun JsonNode.toNotificationExpressions(p: JsonParser): List<NotificationExpression> = this.map { element ->

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/NotificationFormatUtils.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ enum class NotificationScheduleType {
4545
;
4646

4747
companion object {
48-
fun fromString(value: String): NotificationScheduleType {
49-
return when (value.lowercase()) {
48+
fun fromString(value: String): NotificationScheduleType =
49+
when (value.lowercase()) {
5050
"startup" -> STARTUP
5151
else -> EMERGENCY
5252
}
53-
}
5453
}
5554
}
5655

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/ProcessNotificationsBase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ProcessNotificationsBase(
5757
?.filter { notification ->
5858
!NotificationDismissalState.getInstance().isDismissed(notification.id)
5959
}
60-
?: emptyList()
60+
.orEmpty()
6161

6262
activeNotifications.forEach { processNotification(project, it) }
6363
}

0 commit comments

Comments
 (0)