Intention&inspection to use synthetic property instead of get/set method call
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.UsePropertyAccessSyntaxIntention
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
class MyFile : File("file")
|
||||
|
||||
fun foo(file: MyFile) {
|
||||
file.getAbsolutePath()<caret>
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
class MyFile : File("file")
|
||||
|
||||
fun foo(file: MyFile) {
|
||||
file.absolutePath<caret>
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
class MyFile : File("file") {
|
||||
override fun getCanonicalFile(): File {
|
||||
return super.getCanonicalFile()
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(file: MyFile) {
|
||||
file.getCanonicalFile()<caret>
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
class MyFile : File("file") {
|
||||
override fun getCanonicalFile(): File {
|
||||
return super.getCanonicalFile()
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(file: MyFile) {
|
||||
file.canonicalFile<caret>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
import java.io.File
|
||||
|
||||
fun File.foo(absolutePath: String) {
|
||||
getAbsolutePath()<caret>
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
import java.io.File
|
||||
|
||||
val File.absolutePath: String get() = ""
|
||||
|
||||
fun foo(file: File) {
|
||||
file.getAbsolutePath()<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun foo(file: File) {
|
||||
file.getAbsolutePath()<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun foo(file: File) {
|
||||
file.absolutePath<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun File.foo() {
|
||||
getAbsolutePath()<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun File.foo() {
|
||||
absolutePath<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun foo(file: File?) {
|
||||
file?.getAbsolutePath()<caret>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
import java.io.File
|
||||
|
||||
fun foo(file: File?) {
|
||||
file?.absolutePath<caret>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(thread: Thread) {
|
||||
thread.setName("name")<caret>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(thread: Thread) {
|
||||
thread.name = "name"<caret>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun Thread.foo() {
|
||||
setName("name")<caret>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun Thread.foo() {
|
||||
name = "name"<caret>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(thread: Thread?) {
|
||||
thread?.setName("name")<caret>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(thread: Thread?) {
|
||||
thread?.name = "name"<caret>
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
import java.io.File
|
||||
|
||||
class MyFile : File("file") {
|
||||
override fun getCanonicalFile(): File {
|
||||
return super.getCanonicalFile()<caret>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user