Reputation: 2904
I have some problems when trying to migrate my java methods to project with kotlin. I have a method with next signature:
public static RetryTemplate getRetryTemplate(long initialInterval, int maxAttempts, Class<? extends Throwable> throwable) { .... }
or in Kotlin:
fun getRetryTemplate(initialInterval: Long, maxAttempts: Int, throwable: Class<out Throwable>): RetryTemplate? {
When I'm trying to call this method in Kotlin code I get a compiler issue - Local final class no name provided (see screenshot)
RetryUtils.getRetryTemplate(5000, 3, Exception.class)
How to fix it?
Upvotes: 1
Views: 2107
Reputation: 2904
It is required to use Exception::class.java
why Intellij not recommended this solution?
Upvotes: 2