Open jaqxues opened 4 years ago
Similar to #270 and #205 (both fixed apparently)
This happens with local vals (and vars) and using the when (and if) expressions in Kotlin.
val
var
when
if
Example:
return try { val clazz = classLoader.loadClass(className) as Class<out M> val constructor = clazz.getConstructor(Parameter::class.java) constructor.newInstance(arg) } catch (t: Throwable) { val message = when(t) { is ClassNotFoundException -> "Class ($className) not found" is NoSuchMethodException -> "Matching constructor not found." is InvocationTargetException -> "Constructor Invocation failed" else -> "Unknown Error while instantiating Class" } // Use single-argument log method instead of null/empty message Timber.e(t, message) throw ReflectionException(message, t) }
+1 also seeing this false positive with a local val.
Similar to #270 and #205 (both fixed apparently)
This happens with local
val
s (andvar
s) and using thewhen
(andif
) expressions in Kotlin.Example: