Add more "non properties" for atomic classes #KT-25953 Fixed
This commit is contained in:
@@ -90,17 +90,20 @@ class NotPropertiesServiceImpl(private val project: Project) : NotPropertiesServ
|
||||
|
||||
companion object {
|
||||
|
||||
val default = listOf(
|
||||
private val atomicMethods = listOf(
|
||||
"getAndIncrement", "getAndDecrement", "getAcquire", "getOpaque", "getPlain"
|
||||
)
|
||||
|
||||
private val atomicClasses = listOf("AtomicInteger", "AtomicLong")
|
||||
|
||||
val default: List<String> = listOf(
|
||||
"java.net.Socket.getInputStream",
|
||||
"java.net.Socket.getOutputStream",
|
||||
"java.net.URLConnection.getInputStream",
|
||||
"java.net.URLConnection.getOutputStream",
|
||||
"java.util.concurrent.atomic.AtomicInteger.getAndIncrement",
|
||||
"java.util.concurrent.atomic.AtomicInteger.getAndDecrement",
|
||||
"java.util.concurrent.atomic.AtomicLong.getAndIncrement",
|
||||
"java.util.concurrent.atomic.AtomicLong.getAndDecrement"
|
||||
)
|
||||
|
||||
"java.net.URLConnection.getOutputStream"
|
||||
) + atomicClasses.flatMap { klass ->
|
||||
atomicMethods.map { method -> "java.util.concurrent.atomic.$klass.$method" }
|
||||
}
|
||||
|
||||
val USE_PROPERTY_ACCESS_INSPECTION: Key<UsePropertyAccessSyntaxInspection> = Key.create("UsePropertyAccessSyntax")
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_JDK
|
||||
// IS_APPLICABLE: false
|
||||
// DISABLE-ERRORS
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
fun main() {
|
||||
val i = AtomicInteger()
|
||||
val plain = i.get<caret>Plain()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_JDK
|
||||
// IS_APPLICABLE: false
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
fun main() {
|
||||
val l = AtomicLong()
|
||||
val x = l.get<caret>AndIncrement()
|
||||
}
|
||||
@@ -16261,6 +16261,16 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
||||
runTest("idea/testData/intentions/usePropertyAccessSyntax/superCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suppressedByAtomicIntegerList.kt")
|
||||
public void testSuppressedByAtomicIntegerList() throws Exception {
|
||||
runTest("idea/testData/intentions/usePropertyAccessSyntax/suppressedByAtomicIntegerList.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suppressedByAtomicLongList.kt")
|
||||
public void testSuppressedByAtomicLongList() throws Exception {
|
||||
runTest("idea/testData/intentions/usePropertyAccessSyntax/suppressedByAtomicLongList.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suppressedByNotPropertyList.kt")
|
||||
public void testSuppressedByNotPropertyList() throws Exception {
|
||||
runTest("idea/testData/intentions/usePropertyAccessSyntax/suppressedByNotPropertyList.kt");
|
||||
|
||||
Reference in New Issue
Block a user