Skip to content

Commit 62adbc1

Browse files
committed
detekt fixes
1 parent ec5bfbe commit 62adbc1

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/workspace/WorkspaceServiceHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class WorkspaceServiceHandler(
104104
.mapNotNull { event ->
105105
val file = event.file.takeIf { shouldHandleFile(it) } ?: return@mapNotNull null
106106
val oldName = event.oldValue as? String ?: return@mapNotNull null
107-
val newName = event.newValue as? String ?: return@mapNotNull null
107+
if (event.newValue !is String) return@mapNotNull null
108108

109109
// Construct old and new URIs
110110
val parentPath = file.parent?.toNioPath() ?: return@mapNotNull null

plugins/amazonq/shared/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/amazonq/lsp/workspace/WorkspaceServiceHandlerTest.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ class WorkspaceServiceHandlerTest {
282282
oldName = oldName,
283283
newName = newName,
284284
isDirectory = false,
285-
extension = "java"
286285
)
287286

288287
// Act
@@ -304,7 +303,6 @@ class WorkspaceServiceHandlerTest {
304303
oldName = "oldFile.txt",
305304
newName = "newFile.txt",
306305
isDirectory = false,
307-
extension = "txt"
308306
)
309307

310308
// Act
@@ -341,12 +339,10 @@ class WorkspaceServiceHandlerTest {
341339
val event1 = createMockPropertyChangeEvent(
342340
oldName = "old1.java",
343341
newName = "new1.java",
344-
extension = "java"
345342
)
346343
val event2 = createMockPropertyChangeEvent(
347344
oldName = "old2.py",
348345
newName = "new2.py",
349-
extension = "py"
350346
)
351347

352348
// Act
@@ -537,7 +533,6 @@ class WorkspaceServiceHandlerTest {
537533
oldName: String,
538534
newName: String,
539535
isDirectory: Boolean = false,
540-
extension: String = "java",
541536
): VFilePropertyChangeEvent {
542537
val file = mockk<VirtualFile>()
543538
val parent = mockk<VirtualFile>()

0 commit comments

Comments
 (0)