((descriptor.source as JavaSourceElement).javaElement as BinaryJavaMethod).containingClass
at runtime
g
gammax
04/07/2021, 9:38 AM
Iām unsure how to help you š¤ What is
ThrowsTypeBlockingMethodChecker
even doing? Can you provide some example of compliant/non-compliant code?
v
vineethraj49
04/08/2021, 2:58 AM
@gammax, this is used to check if a method is a blocking method
vineethraj49
04/08/2021, 2:59 AM
this is used further with another inspection, which sees if this method call is being made in a non-blocking context
g
gammax
04/08/2021, 12:53 PM
Can you provide some example of compliant/non-compliant code? š
v
vineethraj49
04/08/2021, 10:46 PM
Copy code
V java.util.concurrent.Future#get() throws InterruptedException, ExecutionException; // defined in rt.jar
suspend fun foo() {
val aFuture = asyncHttpClient.executeRequest(r).get() // this `.get` is identified as a blocking call in non-blocking context
}