Fixed bugs in Kotlin Android Lint CleanupDetector

#KT-14780 Fixed
#KT-14677 Fixed

(cherry picked from commit f591b4958e4a836d37d70c2ad8ff15e626c6342a)
This commit is contained in:
Vyacheslav Gerasimov
2017-01-24 13:27:00 +03:00
parent 68b223211c
commit d0f1b81bfa
7 changed files with 307 additions and 126 deletions
+23
View File
@@ -0,0 +1,23 @@
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintRecycleInspection
@file:Suppress("UNUSED_VARIABLE")
import android.app.Activity
import android.os.Bundle
import android.view.VelocityTracker
class MainActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
VelocityTracker.<warning descr="This `VelocityTracker` should be recycled after use with `#recycle()`">obtain</warning>()
VelocityTracker.obtain().recycle()
val v1 = VelocityTracker.<warning descr="This `VelocityTracker` should be recycled after use with `#recycle()`">obtain</warning>()
val v2 = VelocityTracker.obtain()
v2.recycle()
}
}