mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't use deprecated sort (fix compilation errror)
(cherry picked from commit 9d854e289983a6329d5a2f49f4ac0626f1f0eb61)
This commit is contained in:
@@ -401,7 +401,7 @@ class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persistent
|
||||
|
||||
if (myOrder.isEmpty()) {
|
||||
// IDEA-63663 Sort run configurations alphabetically if clean checkout
|
||||
order.sort { o1, o2 ->
|
||||
order.sortWith(Comparator { o1, o2 ->
|
||||
val temporary1 = o1.getSecond().isTemporary
|
||||
val temporary2 = o2.getSecond().isTemporary
|
||||
when {
|
||||
@@ -409,14 +409,14 @@ class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persistent
|
||||
temporary1 -> 1
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
order.sort { o1, o2 ->
|
||||
order.sortWith(Comparator { o1, o2 ->
|
||||
val i1 = folderNames.indexOf(o1.getSecond().folderName)
|
||||
val i2 = folderNames.indexOf(o2.getSecond().folderName)
|
||||
if (i1 != i2) {
|
||||
return@sort i1 -i2
|
||||
return@Comparator i1 - i2
|
||||
}
|
||||
|
||||
val temporary1 = o1.getSecond().isTemporary
|
||||
@@ -435,7 +435,7 @@ class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persistent
|
||||
temporary1 -> 1
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
for (each in order) {
|
||||
|
||||
+5
-4
@@ -32,6 +32,7 @@ import com.intellij.util.SmartList
|
||||
import gnu.trove.THashMap
|
||||
import gnu.trove.THashSet
|
||||
import org.jdom.Element
|
||||
import java.util.*
|
||||
|
||||
private val LOG = logger<RunnerAndConfigurationSettings>()
|
||||
|
||||
@@ -432,10 +433,10 @@ class RunnerAndConfigurationSettingsImpl @JvmOverloads constructor(private val m
|
||||
}
|
||||
}
|
||||
unloadedSettings?.mapTo(runnerSettings) { it.clone() }
|
||||
runnerSettings.sort { o1, o2 ->
|
||||
val attributeValue1 = o1.getAttributeValue(RUNNER_ID)
|
||||
if (attributeValue1 == null) 1 else StringUtil.compare(attributeValue1, o2.getAttributeValue(RUNNER_ID), false)
|
||||
}
|
||||
runnerSettings.sortWith<Element>(Comparator { o1, o2 ->
|
||||
val attributeValue1 = o1.getAttributeValue(RUNNER_ID) ?: return@Comparator 1
|
||||
StringUtil.compare(attributeValue1, o2.getAttributeValue(RUNNER_ID), false)
|
||||
})
|
||||
for (runnerSetting in runnerSettings) {
|
||||
element.addContent(runnerSetting)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user