Skip to content

Commit 5c87fd9

Browse files
authored
Cleanup compiler warnings (#3094)
1 parent 4de7d7b commit 5c87fd9

File tree

40 files changed

+95
-98
lines changed

40 files changed

+95
-98
lines changed

jetbrains-core/src/software/aws/toolkits/jetbrains/core/AwsResourceCache.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.intellij.openapi.project.Project
1111
import com.intellij.util.Alarm
1212
import com.intellij.util.AlarmFactory
1313
import kotlinx.coroutines.Deferred
14+
import kotlinx.coroutines.ExperimentalCoroutinesApi
1415
import kotlinx.coroutines.async
1516
import kotlinx.coroutines.coroutineScope
1617
import kotlinx.coroutines.launch
@@ -273,6 +274,7 @@ class ExecutableBackedCacheResource<ReturnType, ExecType : ExecutableType<*>>(
273274
override fun toString(): String = "ExecutableBackedCacheResource(id='$id')"
274275
}
275276

277+
@ExperimentalCoroutinesApi
276278
class DefaultAwsResourceCache(
277279
private val clock: Clock,
278280
private val maximumCacheEntries: Int,

jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/ExplorerToolWindow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ExplorerToolWindow(project: Project) : SimpleToolWindowPanel(true, true),
8080
private val awsTreeModel = AwsExplorerTreeStructure(project)
8181

8282
// The 4 max threads is arbitrary, but we want > 1 so that we can load more than one node at a time
83-
private val structureTreeModel = StructureTreeModel(awsTreeModel, null, Invoker.Background(this, 4), this)
83+
private val structureTreeModel = StructureTreeModel(awsTreeModel, null, Invoker.forBackgroundPoolWithReadAction(this), this)
8484
private val awsTree = createTree(AsyncTreeModel(structureTreeModel, true, this))
8585
private val awsTreePanel = ScrollPaneFactory.createScrollPane(awsTree)
8686
private val accountSettingsManager = AwsConnectionManager.getInstance(project)

jetbrains-core/src/software/aws/toolkits/jetbrains/core/tools/ToolConfigurable.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class ToolConfigurable : BoundConfigurable(message("executableCommon.configurabl
5353
}
5454

5555
override fun disposeUIResources() {
56+
// TODO: why are we overriding and not allowing the disposable to be disposed?
5657
panel.drop()
5758
}
5859

jetbrains-core/src/software/aws/toolkits/jetbrains/services/clouddebug/CloudDebugResolver.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature
88
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
99
import com.intellij.openapi.project.Project
1010
import com.intellij.openapi.util.SystemInfo
11+
import com.intellij.util.system.CpuArch
1112
import com.intellij.util.text.SemVer
1213
import org.apache.commons.codec.digest.DigestUtils
1314
import software.aws.toolkits.jetbrains.core.executables.ExecutableInstance
@@ -149,7 +150,7 @@ object CloudDebugResolver {
149150
}
150151

151152
private fun generateCloudDebugManifestUrl(suffix: String): String {
152-
if (!SystemInfo.is64Bit) {
153+
if (CpuArch.CURRENT.width != 64) {
153154
throw RuntimeException("Cloud Debugging requires a 64-bit OS")
154155
}
155156
val os = when {

jetbrains-core/src/software/aws/toolkits/jetbrains/services/clouddebug/execution/CloudDebugCliStep.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ import java.util.concurrent.atomic.AtomicReference
2424
abstract class CloudDebugCliStep : CliBasedStep() {
2525
protected fun getCli(context: Context): GeneralCommandLine = context.getRequiredAttribute(CloudDebugCliValidate.EXECUTABLE_ATTRIBUTE).getCommandLine()
2626

27-
override fun handleErrorResult(exitCode: Int, output: String, messageEmitter: StepEmitter) {
27+
override fun handleErrorResult(exitCode: Int, output: String, stepEmitter: StepEmitter) {
2828
if (output.isNotEmpty()) {
29-
messageEmitter.emitMessage("Error details:\n", true)
29+
stepEmitter.emitMessage("Error details:\n", true)
3030
CliOutputParser.parseErrorOutput(output)?.run {
3131
errors.forEach {
32-
messageEmitter.emitMessage("\t- $it\n", true)
32+
stepEmitter.emitMessage("\t- $it\n", true)
3333
}
34-
} ?: messageEmitter.emitMessage(output, true)
34+
} ?: stepEmitter.emitMessage(output, true)
3535
}
3636

3737
throw IllegalStateException(message("cloud_debug.step.general.cli_error"))
3838
}
3939

40-
override fun createProcessEmitter(messageEmitter: StepEmitter): ProcessListener = CliOutputEmitter(messageEmitter)
40+
override fun createProcessEmitter(stepEmitter: StepEmitter): ProcessListener = CliOutputEmitter(stepEmitter)
4141

4242
private class CliOutputEmitter(private val messageEmitter: StepEmitter) : ProcessAdapter() {
4343
val previousLevel = AtomicReference<Level>(null)

jetbrains-core/src/software/aws/toolkits/jetbrains/services/clouddebug/execution/steps/CloudDebugCliValidate.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import software.aws.toolkits.resources.message
1717
class CloudDebugCliValidate : Step() {
1818
override val stepName = "Checking for cloud-debug validity and updates"
1919

20-
override fun execute(context: Context, messageEmitter: StepEmitter, ignoreCancellation: Boolean) {
21-
CloudDebugResolver.validateOrUpdateCloudDebug(context.getRequiredAttribute(Context.PROJECT_ATTRIBUTE), messageEmitter, context)
20+
override fun execute(context: Context, stepEmitter: StepEmitter, ignoreCancellation: Boolean) {
21+
CloudDebugResolver.validateOrUpdateCloudDebug(context.getRequiredAttribute(Context.PROJECT_ATTRIBUTE), stepEmitter, context)
2222
}
2323

2424
companion object {

jetbrains-core/src/software/aws/toolkits/jetbrains/services/clouddebug/execution/steps/ResourceInstrumenter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ResourceInstrumenter(private val settings: EcsServiceCloudDebuggingRunSett
5151
)
5252
}
5353

54-
override fun handleSuccessResult(output: String, messageEmitter: StepEmitter, context: Context) {
54+
override fun handleSuccessResult(output: String, stepEmitter: StepEmitter, context: Context) {
5555
val targets = CliOutputParser.parseInstrumentResponse(output) ?: throw RuntimeException("Could not get targets from response")
5656
/* TODO uncomment this when the cli conforms to the contract
5757
val mappedTargets = targets.targets.map { it.name to it.target }.toMap()

jetbrains-core/src/software/aws/toolkits/jetbrains/services/clouddebug/execution/steps/RetrieveRole.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RetrieveRole(private val settings: EcsServiceCloudDebuggingRunSettings) :
2222

2323
override fun execute(
2424
context: Context,
25-
messageEmitter: StepEmitter,
25+
stepEmitter: StepEmitter,
2626
ignoreCancellation: Boolean
2727
) {
2828
val startTime = Instant.now()

jetbrains-core/src/software/aws/toolkits/jetbrains/services/clouddebug/execution/steps/StopApplications.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ class StopApplication(
6565
)
6666
}
6767

68-
override fun handleErrorResult(exitCode: Int, output: String, messageEmitter: StepEmitter) =
68+
override fun handleErrorResult(exitCode: Int, output: String, stepEmitter: StepEmitter) =
6969
if (isCleanup) {
70-
super.handleErrorResult(exitCode, output, messageEmitter)
70+
super.handleErrorResult(exitCode, output, stepEmitter)
7171
} else {
72-
messageEmitter.emitMessage(output, true)
72+
stepEmitter.emitMessage(output, true)
7373
// suppress the error if stop fails
7474
}
7575
}

jetbrains-core/src/software/aws/toolkits/jetbrains/services/cloudformation/stack/EventsFetcher.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class EventsFetcher(private val stackName: String) {
4242
when (pageToSwitchTo) {
4343
Page.NEXT -> currentPage?.let { previousPages.add(it) } // Store current as prev
4444
Page.PREVIOUS -> if (previousPages.isNotEmpty()) previousPages.removeAt(previousPages.size - 1)
45+
else -> {}
4546
}
4647
nextPage = response.nextToken()
4748
currentPage = pageToFetch

0 commit comments

Comments
 (0)