Skip to content

Commit

Permalink
fix: cleanup code & warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiandoetsch committed Feb 7, 2024
1 parent 98dc9b2 commit dfe3fc5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class SnykCliAuthenticationService(val project: Project) {
private fun downloadCliIfNeeded() {
val downloadCliTask: () -> Unit = {
if (!getCliFile().exists()) {
val currentIndicator = ProgressManager.getInstance().progressIndicator
getSnykTaskQueueService(project)?.downloadLatestRelease()
} else {
logger.debug("Skip CLI download, since it was already downloaded")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SuggestionTreeNode(
override val navigateToSource: () -> Unit
) : DefaultMutableTreeNode(Pair(suggestion, rangeIndex)), NavigatableToSourceTreeNode, DescriptionHolderTreeNode {

@Suppress("UNCHECKED_CAST")
override fun getDescriptionPanel(logEventNeeded: Boolean): IssueDescriptionPanelBase {
if (logEventNeeded) getSnykAnalyticsService().logIssueInTreeIsClicked(
IssueInTreeIsClicked.builder()
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/snyk/PluginInformation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private fun getPluginInformation(): PluginInformation {
return PluginInformation(
integrationName = "JETBRAINS_IDE",
integrationVersion = snykPluginVersion,
integrationEnvironment = integrationEnvironment.toUpperCase(),
integrationEnvironment = integrationEnvironment.uppercase(),
integrationEnvironmentVersion = applicationInfo.fullVersion
)
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/snyk/common/UIComponentFinder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import kotlin.reflect.cast

object UIComponentFinder {

@OptIn(ExperimentalStdlibApi::class)
fun <T : Component> getComponentByName(parent: Container, clazz: KClass<T>, name: String? = null): T? =
getComponentByCondition(parent, clazz) { name == null || name == it.name }

@OptIn(ExperimentalStdlibApi::class)
@Suppress("UNCHECKED_CAST")
fun <T : Component> getComponentByCondition(parent: Container, clazz: KClass<T>, condition: (T) -> Boolean): T? {
val components = parent.components
var found: T? = null
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/snyk/common/lsp/LanguageServerSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package snyk.common.lsp

import com.google.gson.annotations.SerializedName
import io.snyk.plugin.pluginSettings
import org.apache.commons.lang.SystemUtils
import org.apache.commons.lang3.SystemUtils
import snyk.pluginInfo

data class LanguageServerSettings(
Expand Down

0 comments on commit dfe3fc5

Please sign in to comment.