Remove backward compatibility flag
Kotlin updates to 1.4 and fixes an issue where @JvmOverload methods were not final. See https://kotlinlang.org/docs/reference/compatibility-guide-14.html#generated-overloads-for-jvmoverloads-on-open-methods-should-be-final Remove the backward compatibility flag by special-casing the method that needs to be overridden at this time, which gets rid of the local concern. Bug: 166499531 Test: Builds, atest ConnectivityServiceTest Change-Id: Ia13c67876f99dafd77d890e82d62453713b7b5fe
This commit is contained in:
@@ -102,9 +102,6 @@ java_library {
|
|||||||
"net-tests-utils-host-device-common",
|
"net-tests-utils-host-device-common",
|
||||||
"net-utils-device-common",
|
"net-utils-device-common",
|
||||||
],
|
],
|
||||||
kotlincflags: [
|
|
||||||
"-XXLanguage:-GenerateJvmOverloadsAsFinal"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
filegroup {
|
filegroup {
|
||||||
|
|||||||
@@ -170,8 +170,11 @@ open class TestableNetworkCallback private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make open for use in ConnectivityServiceTest which is the only one knowing its handlers.
|
// Make open for use in ConnectivityServiceTest which is the only one knowing its handlers.
|
||||||
@JvmOverloads
|
// TODO : remove the necessity to overload this, remove the open qualifier, and give a
|
||||||
open fun assertNoCallback(timeoutMs: Long = defaultTimeoutMs) {
|
// default argument to assertNoCallback instead, possibly with @JvmOverloads if necessary.
|
||||||
|
open fun assertNoCallback() = assertNoCallback(defaultTimeoutMs)
|
||||||
|
|
||||||
|
fun assertNoCallback(timeoutMs: Long) {
|
||||||
val cb = history.poll(timeoutMs)
|
val cb = history.poll(timeoutMs)
|
||||||
if (null != cb) fail("Expected no callback but got $cb")
|
if (null != cb) fail("Expected no callback but got $cb")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user