Skip to content

Commit cb9a8e9

Browse files
committed
fix warning
1 parent d861bca commit cb9a8e9

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/main/kotlin/com/github/adrienpessu/sarifviewer/services/SarifService.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ package com.github.adrienpessu.sarifviewer.services
22

33
import com.contrastsecurity.sarif.SarifSchema210
44
import com.fasterxml.jackson.databind.ObjectMapper
5-
import com.fasterxml.jackson.jr.ob.JSON
65
import com.fasterxml.jackson.module.kotlin.readValue
76
import com.github.adrienpessu.sarifviewer.exception.SarifViewerException
87
import com.github.adrienpessu.sarifviewer.models.Leaf
98
import com.github.adrienpessu.sarifviewer.models.Root
109
import com.intellij.openapi.components.Service
11-
import com.intellij.openapi.project.Project
1210
import net.minidev.json.JSONArray
1311
import java.net.HttpURLConnection
1412
import java.net.URL
@@ -32,7 +30,7 @@ class SarifService {
3230
}
3331

3432
fun analyseSarif(sarif: SarifSchema210): HashMap<String, MutableList<Leaf>> {
35-
val map = HashMap<String, MutableList<Leaf>>();
33+
val map = HashMap<String, MutableList<Leaf>>()
3634

3735
sarif.runs.forEach { run ->
3836
run.results.forEach { result ->

src/main/kotlin/com/github/adrienpessu/sarifviewer/toolWindow/SarifViewerWindowFactory.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import javax.swing.event.TreeSelectionListener
4242
import javax.swing.text.html.HTMLEditorKit
4343
import javax.swing.tree.DefaultMutableTreeNode
4444
import javax.swing.tree.DefaultTreeModel
45-
import javax.swing.tree.TreeNode
4645

4746

4847
class SarifViewerWindowFactory : ToolWindowFactory {
@@ -160,7 +159,7 @@ class SarifViewerWindowFactory : ToolWindowFactory {
160159
NotificationGroupManager.getInstance()
161160
.getNotificationGroup("SARIF viewer")
162161
.createNotification(message, NotificationType.ERROR)
163-
.notify(project);
162+
.notify(project)
164163

165164
thisLogger().info(message)
166165
}
@@ -269,7 +268,7 @@ class SarifViewerWindowFactory : ToolWindowFactory {
269268
myList = JTree(root)
270269

271270
myList.isRootVisible = false
272-
main = ScrollPaneFactory.createScrollPane(myList);
271+
main = ScrollPaneFactory.createScrollPane(myList)
273272

274273
details.isVisible = false
275274

@@ -308,11 +307,11 @@ class SarifViewerWindowFactory : ToolWindowFactory {
308307
}
309308
}
310309
}
311-
});
310+
})
312311
}
313312

314313
private fun manageTreeIcons() {
315-
val tmpPath: Path? = Files.createTempFile("warning", ".svg");
314+
val tmpPath: Path? = Files.createTempFile("warning", ".svg")
316315
val tmpFile = File(tmpPath!!.toUri())
317316
val writer = FileWriter(tmpFile)
318317
writer.write(Icons.ICON_WARNING)

src/main/kotlin/com/github/adrienpessu/sarifviewer/utils/Icons.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Icons {
44

55
companion object {
66
const val ICON_WARNING = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" width=\"12\" height=\"12\"><path d=\"M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\"></path></svg>"
7-
const val ICON_DIRECTORY = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M0 2.75C0 1.784.784 1 1.75 1H5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1h6.75c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25Zm1.75-.25a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H7.5c-.55 0-1.07-.26-1.4-.7l-.9-1.2a.25.25 0 0 0-.2-.1Z\"></path></svg>"
7+
// const val ICON_DIRECTORY = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M0 2.75C0 1.784.784 1 1.75 1H5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1h6.75c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25Zm1.75-.25a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H7.5c-.55 0-1.07-.26-1.4-.7l-.9-1.2a.25.25 0 0 0-.2-.1Z\"></path></svg>"
88
const val ERROR = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M0 2.75C0 1.784.784 1 1.75 1H5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1h6.75c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25Zm1.75-.25a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H7.5c-.55 0-1.07-.26-1.4-.7l-.9-1.2a.25.25 0 0 0-.2-.1Z\"></path></svg>"
99
}
1010
}

0 commit comments

Comments
 (0)