Stop using deprecated APIs

This commit is contained in:
Ilya Ryzhenkov
2014-12-02 15:41:22 +03:00
parent 2b8ffeda28
commit be717f48f8
45 changed files with 111 additions and 112 deletions
@@ -183,7 +183,7 @@ class CollectionStubMethodGenerator(
private fun Collection<JetType>.findMostSpecificTypeForClass(klass: ClassDescriptor): JetType {
val types = this.filter { it.getConstructor().getDeclarationDescriptor() == klass }
if (types.isEmpty()) error("No supertype of $klass in $this")
if (types.size == 1) return types.first()
if (types.size() == 1) return types.first()
// Find the first type in the list such that it's a subtype of every other type in that list
return types.first { type ->
types.all { other -> JetTypeChecker.DEFAULT.isSubtypeOf(type, other) }
@@ -76,7 +76,7 @@ public abstract class SignatureCollectingClassBuilderFactory(
override fun done() {
var hasDuplicateSignatures = false
for ((signature, elementsAndDescriptors) in signatures.entrySet()!!) {
if (elementsAndDescriptors.size == 1) continue // no clash
if (elementsAndDescriptors.size() == 1) continue // no clash
handleClashingSignatures(ConflictingJvmDeclarationsData(
classInternalName,
classCreatedFor,
@@ -120,7 +120,7 @@ private class StoredStackValuesDescriptor(
alreadyStoredValuesCount: Int
) {
val nextFreeVarIndex : Int get() = firstVariableIndex + storedStackSize
val storedValuesCount: Int get() = values.size
val storedValuesCount: Int get() = values.size()
val isStored: Boolean get() = storedValuesCount > 0
val totalValuesCountOnStackBeforeInline = alreadyStoredValuesCount + storedValuesCount
}