Added second quickfix on conflicting extension to mark it hidden and deprecated

This commit is contained in:
Valentin Kipyatkov
2015-08-31 23:43:02 +03:00
parent b2ea369129
commit 086d29a44a
36 changed files with 91 additions and 31 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.ConflictingExtensionPropertyInspection
@@ -0,0 +1,7 @@
// "Delete redundant extension property" "true"
var Thread.<caret>priority: Int
get() = this.getPriority()
set(value) {
this.setPriority(value)
}
@@ -0,0 +1,2 @@
// "Delete redundant extension property" "true"
@@ -0,0 +1,5 @@
// "Mark with @HiddenDeclaration and @deprecated" "true"
import java.io.File
val File.<caret>name: String
get() = getName()
@@ -0,0 +1,7 @@
// "Mark with @HiddenDeclaration and @deprecated" "true"
import java.io.File
@HiddenDeclaration
@deprecated("Is replaced with automatic synthetic extension", ReplaceWith("name"))
val File.<caret>name: String
get() = getName()
@@ -0,0 +1,7 @@
// "Delete redundant extension property" "true"
import java.io.File
class C {
val File.<caret>name: String
get() = getName()
}
@@ -0,0 +1,5 @@
// "Delete redundant extension property" "true"
import java.io.File
class C {
}
@@ -0,0 +1,4 @@
package test
fun foo() {
}
@@ -0,0 +1,8 @@
package test
import java.io.File
import utils.*
fun foo(file: File) {
print(file.name)
}
@@ -0,0 +1,7 @@
package test
import java.io.File
fun foo(file: File) {
print(file.name)
}
@@ -0,0 +1,6 @@
// "Delete redundant extension property" "true"
package utils
import java.io.File
// WITH_RUNTIME
@@ -0,0 +1,6 @@
package test
import utils.name
fun foo() {
}
@@ -0,0 +1,9 @@
// "Delete redundant extension property" "true"
package utils
import java.io.File
val File.<caret>name: String
get() = getName()
// WITH_RUNTIME
@@ -0,0 +1,8 @@
package test
import java.io.File
import utils.*
fun foo(file: File) {
print(file.name)
}
@@ -0,0 +1,8 @@
package test
import java.io.File
import utils.name
fun foo(file: File) {
print(file.name)
}
@@ -0,0 +1,9 @@
package test
import java.io.File
import utils.name
fun foo(file: File, thread: Thread) {
print(file.name)
print(thread.name)
}
@@ -0,0 +1,9 @@
// "Delete redundant extension property" "true"
package utils
import java.io.File
val Thread.name: String
get() = getName()
// WITH_RUNTIME
@@ -0,0 +1,12 @@
// "Delete redundant extension property" "true"
package utils
import java.io.File
val File.<caret>name: String
get() = getName()
val Thread.name: String
get() = getName()
// WITH_RUNTIME
@@ -0,0 +1,9 @@
package test
import java.io.File
import utils.name
fun foo(file: File, thread: Thread) {
print(file.name)
print(thread.name)
}
@@ -0,0 +1,5 @@
// "Delete redundant extension property" "true"
import java.io.File
val File.<caret>name: String
get() { return getName() }
@@ -0,0 +1,3 @@
// "Delete redundant extension property" "true"
import java.io.File
@@ -0,0 +1,5 @@
// "Delete redundant extension property" "true"
import java.io.File
val File.<caret>name: String
get() = getName()
@@ -0,0 +1,3 @@
// "Delete redundant extension property" "true"
import java.io.File
@@ -0,0 +1,4 @@
// "Delete redundant extension property" "true"
val Thread.<caret>priority: Int
get() = getPriority()
@@ -0,0 +1,2 @@
// "Delete redundant extension property" "true"
@@ -0,0 +1,6 @@
// "Delete redundant extension property" "false"
import java.io.File
var File.<caret>name: String
get() = getName()
set(value) {}
@@ -0,0 +1,7 @@
// "Delete redundant extension property" "true"
var Thread.<caret>priority: Int
get() = getPriority()
set(value) {
setPriority(value)
}
@@ -0,0 +1,2 @@
// "Delete redundant extension property" "true"
@@ -0,0 +1,7 @@
// "Delete redundant extension property" "false"
// ACTION: Convert property to function
class C : Thread() {
val Thread.<caret>priority: Int
get() = this@C.getPriority()
}
@@ -0,0 +1,9 @@
// "Delete redundant extension property" "false"
class C : Thread() {
var Thread.<caret>priority: Int
get() = getPriority()
set(value) {
this@C.setPriority(value)
}
}
@@ -0,0 +1,7 @@
// "Delete redundant extension property" "false"
var Thread.<caret>priority: Int
get() = getPriority() + 1
set(value) {
setPriority(value)
}
@@ -0,0 +1,6 @@
// "Delete redundant extension property" "false"
// ACTION: Convert property to function
import java.io.File
public val File.<caret>parent: File?
get() = getParentFile()
@@ -0,0 +1,8 @@
// "Delete redundant extension property" "false"
var Thread.<caret>priority: Int
get() = this.getPriority()
set(value) {
this.setPriority(value)
System.out.print("set")
}