Skip to content

Commit

Permalink
Fix jdk21 BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
CppCXY committed Sep 20, 2024
1 parent 25a3061 commit 5a93e0c
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@ class EmmyAttachGroup : XAttachProcessPresentationGroup {
}

override fun getItemIcon(project: Project, processInfo: ProcessInfo, userDataHolder: UserDataHolder): Icon {
val map = userDataHolder.getUserData(EmmyAttachDebuggerProvider.DETAIL_KEY)
if (map != null) {
val detail = map[processInfo.pid]
if (detail != null) {
val file = File(detail.path)
if (file.exists()) {
val sf = FileSystemView.getFileSystemView()
return sf.getSystemIcon(file)
}
}
}
// JDK21 BUG: getSystemIcon throw a error
// val map = userDataHolder.getUserData(EmmyAttachDebuggerProvider.DETAIL_KEY)
// if (map != null) {
// val detail = map[processInfo.pid]
// if (detail != null) {
// val file = File(detail.path)
// if (file.exists()) {
// val sf = FileSystemView.getFileSystemView()
// return sf.getSystemIcon(file)
// }
// }
// }
return LuaIcons.FILE
}

Expand Down

0 comments on commit 5a93e0c

Please sign in to comment.