Change testData for IntentionsTestGenerated to avoid using javax and sql packages

- Those packages are missing in the mockJdk 1.8 in intellij repository,
and it leads to those tests failing in kotlin-ide repository
This commit is contained in:
Roman Golyshev
2020-06-04 18:12:02 +03:00
committed by Roman Golyshev
parent 22b558110d
commit 7d662bf5d1
36 changed files with 153 additions and 170 deletions
@@ -1,3 +1,3 @@
// WITH_RUNTIME
fun <caret>foo() = java.io.File("x").toURI()
fun <caret>foo() = java.io.File("x").getAbsolutePath()
@@ -1,7 +1,5 @@
import java.net.URI
// WITH_RUNTIME
fun foo(): URI? {
return java.io.File("x").toURI()
fun foo(): String? {
return java.io.File("x").getAbsolutePath()
}
@@ -1,17 +1,15 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.invokeLater
import java.util.regex.Pattern
import java.util.regex.Pattern.matches
fun foo() {
<caret>SwingUtilities.invokeLater { }
<caret>Pattern.matches("", "")
val bottom = SwingUtilities.BOTTOM
val field = Pattern.CASE_INSENSITIVE
SwingUtilities.invokeAndWait {
SwingUtilities.invokeLater { }
}
Pattern.compile("")
val horizontal = javax.swing.SwingUtilities.HORIZONTAL
val fieldFqn = java.util.regex.Pattern.CASE_INSENSITIVE
}
@@ -1,17 +1,15 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.*
import java.util.regex.Pattern
import java.util.regex.Pattern.*
fun foo() {
<caret>invokeLater { }
<caret>matches("", "")
val bottom = BOTTOM
val field = CASE_INSENSITIVE
invokeAndWait {
invokeLater { }
}
compile("")
val horizontal = HORIZONTAL
val fieldFqn = CASE_INSENSITIVE
}
@@ -1,17 +1,15 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.*
import java.util.regex.Pattern
import java.util.regex.Pattern.*
fun foo() {
<caret>SwingUtilities.invokeLater { }
<caret>Pattern.matches("", "")
val bottom = SwingUtilities.BOTTOM
val field = Pattern.CASE_INSENSITIVE
SwingUtilities.invokeAndWait {
SwingUtilities.invokeLater { }
}
Pattern.compile("")
val horizontal = javax.swing.SwingUtilities.HORIZONTAL
val fieldFqn = java.util.regex.Pattern.CASE_INSENSITIVE
}
@@ -1,17 +1,15 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.*
import java.util.regex.Pattern
import java.util.regex.Pattern.*
fun foo() {
<caret>invokeLater { }
<caret>matches("", "")
val bottom = BOTTOM
val field = CASE_INSENSITIVE
invokeAndWait {
invokeLater { }
}
compile("")
val horizontal = HORIZONTAL
val fieldFqn = CASE_INSENSITIVE
}
@@ -0,0 +1,6 @@
public class JavaUtilClass {
public static int STATIC_FIELD = 10;
public static void overloadedMethod(int i) {}
public static void overloadedMethod(String i) {}
}
@@ -0,0 +1,6 @@
public class JavaUtilClass {
public static int STATIC_FIELD = 10;
public static void overloadedMethod(int i) {}
public static void overloadedMethod(String i) {}
}
@@ -1,17 +1,15 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'JavaUtilClass'"
// WITH_RUNTIME
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun convertPoint(source: Component!, aPoint: Point!, destination: Component!): Point! defined in javax.swing.SwingUtilities<br>public open fun convertPoint(source: Component!, x: Int, y: Int, destination: Component!): Point! defined in javax.swing.SwingUtilities
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun convertPoint(source: Component!, aPoint: Point!, destination: Component!): Point! defined in javax.swing.SwingUtilities<br>public open fun convertPoint(source: Component!, x: Int, y: Int, destination: Component!): Point! defined in javax.swing.SwingUtilities
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun overloadedMethod(i: Int): Unit defined in JavaUtilClass<br>public open fun overloadedMethod(i: String!): Unit defined in JavaUtilClass
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun overloadedMethod(i: Int): Unit defined in JavaUtilClass<br>public open fun overloadedMethod(i: String!): Unit defined in JavaUtilClass
// ERROR: Unresolved reference: unresolved
import javax.swing.SwingUtilities
fun foo() {
<caret>SwingUtilities.convertPoint()
<caret>JavaUtilClass.overloadedMethod()
val bottom = SwingUtilities.BOTTOM
val bottom = JavaUtilClass.STATIC_FIELD
SwingUtilities.convertPoint()
JavaUtilClass.overloadedMethod()
SwingUtilities.unresolved
JavaUtilClass.unresolved
}
@@ -1,18 +1,17 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
import JavaUtilClass.*
// INTENTION_TEXT: "Import members from 'JavaUtilClass'"
// WITH_RUNTIME
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun convertPoint(source: Component!, aPoint: Point!, destination: Component!): Point! defined in javax.swing.SwingUtilities<br>public open fun convertPoint(source: Component!, x: Int, y: Int, destination: Component!): Point! defined in javax.swing.SwingUtilities
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun convertPoint(source: Component!, aPoint: Point!, destination: Component!): Point! defined in javax.swing.SwingUtilities<br>public open fun convertPoint(source: Component!, x: Int, y: Int, destination: Component!): Point! defined in javax.swing.SwingUtilities
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun overloadedMethod(i: Int): Unit defined in JavaUtilClass<br>public open fun overloadedMethod(i: String!): Unit defined in JavaUtilClass
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun overloadedMethod(i: Int): Unit defined in JavaUtilClass<br>public open fun overloadedMethod(i: String!): Unit defined in JavaUtilClass
// ERROR: Unresolved reference: unresolved
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.*
fun foo() {
<caret>convertPoint()
overloadedMethod()
val bottom = BOTTOM
val bottom = STATIC_FIELD
convertPoint()
overloadedMethod()
SwingUtilities.unresolved
JavaUtilClass.unresolved
}
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
import javax.swing.<caret>SwingConstants.CENTER
import java.util.regex.<caret>Pattern.CASE_INSENSITIVE
+2 -2
View File
@@ -1,6 +1,6 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
fun foo() {
javax.swing.SwingUtilities<caret>.invokeLater { }
java.util.regex.Pattern<caret>.CASE_INSENSITIVE
}
@@ -1,8 +1,8 @@
import javax.swing.SwingUtilities.*
import java.util.regex.Pattern.*
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
fun foo() {
<caret>invokeLater { }
CASE_INSENSITIVE
}
@@ -1,6 +1,6 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.Objects'"
// WITH_RUNTIME
fun foo() {
<caret>javax.swing.SwingUtilities.invokeLater { }
<caret>java.util.Objects.equals(null, null)
}
@@ -1,8 +1,8 @@
import javax.swing.SwingUtilities.*
import java.util.Objects.*
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.Objects'"
// WITH_RUNTIME
fun foo() {
<caret>invokeLater { }
equals(null, null)
}
@@ -1,17 +1,15 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.invokeLater
import java.util.regex.Pattern
import java.util.regex.Pattern.matches
fun foo() {
invokeLater { }
matches("", "")
val bottom = <caret>SwingUtilities.BOTTOM
val field = <caret>Pattern.CASE_INSENSITIVE
SwingUtilities.invokeAndWait {
invokeLater { }
}
Pattern.compile("")
val horizontal = javax.swing.SwingUtilities.HORIZONTAL
val fieldFqn = java.util.regex.Pattern.CASE_INSENSITIVE
}
@@ -1,17 +1,15 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.*
import java.util.regex.Pattern
import java.util.regex.Pattern.*
fun foo() {
invokeLater { }
matches("", "")
val bottom = <caret>BOTTOM
val field = CASE_INSENSITIVE
invokeAndWait {
invokeLater { }
}
compile("")
val horizontal = HORIZONTAL
val fieldFqn = CASE_INSENSITIVE
}
@@ -1,19 +1,17 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
// ERROR: Unresolved reference: unresolved
import javax.swing.SwingUtilities
import java.util.regex.Pattern
fun foo() {
SwingUtilities.invokeLater { }
Pattern.matches("", "")
val bottom = <caret>SwingUtilities.BOTTOM
val field = <caret>Pattern.CASE_INSENSITIVE
SwingUtilities.invokeAndWait {
SwingUtilities.invokeLater { }
}
Pattern.compile("")
val horizontal = javax.swing.SwingUtilities.HORIZONTAL
val fieldFqn = java.util.regex.Pattern.CASE_INSENSITIVE
SwingUtilities.unresolved
Pattern.unresolved
}
@@ -1,20 +1,18 @@
// INTENTION_TEXT: "Import members from 'javax.swing.SwingUtilities'"
// INTENTION_TEXT: "Import members from 'java.util.regex.Pattern'"
// WITH_RUNTIME
// ERROR: Unresolved reference: unresolved
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.*
import java.util.regex.Pattern
import java.util.regex.Pattern.*
fun foo() {
invokeLater { }
matches("", "")
val bottom = <caret>BOTTOM
val field = <caret>CASE_INSENSITIVE
invokeAndWait {
invokeLater { }
}
compile("")
val horizontal = HORIZONTAL
val fieldFqn = CASE_INSENSITIVE
SwingUtilities.unresolved
Pattern.unresolved
}
@@ -2,6 +2,6 @@
// WITH_RUNTIME
// ERROR: Unresolved reference: unresolved
import javax.swing.SwingUtilities
import java.util.Objects
val v = <caret>SwingUtilities.unresolved()
val v = <caret>Objects.unresolved()
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
import javax.swing.SwingConstants.<caret>CENTER
import java.util.regex.Pattern.<caret>CASE_INSENSITIVE
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
import javax.swing.<caret>SwingConstants.CENTER
import java.util.regex.<caret>Pattern.CASE_INSENSITIVE
+3 -4
View File
@@ -1,10 +1,9 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
// ERROR: Unresolved reference: xxx
// ERROR: Unresolved reference: unresolved
import javax.swing.SwingUtilities
import java.util.regex.Pattern
fun foo() {
SwingUtilities.<caret>xxx {
}
Pattern.<caret>unresolved()
}
+2 -3
View File
@@ -1,9 +1,8 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
import javax.swing.SwingUtilities
import java.util.regex.Pattern
fun foo() {
<caret>SwingUtilities.invokeLater {
}
<caret>Pattern.CASE_INSENSITIVE
}
+4 -4
View File
@@ -1,10 +1,10 @@
// INTENTION_TEXT: "Add import for 'javax.swing.SwingConstants.CENTER'"
// INTENTION_TEXT: "Add import for 'java.util.regex.Pattern.CASE_INSENSITIVE'"
// WITH_RUNTIME
import javax.swing.SwingConstants
import java.util.regex.Pattern
fun foo() {
val v = SwingConstants.CENTER
val v = Pattern.CASE_INSENSITIVE
SwingConstants.<caret>CENTER
Pattern.<caret>CASE_INSENSITIVE
}
@@ -1,11 +1,11 @@
// INTENTION_TEXT: "Add import for 'javax.swing.SwingConstants.CENTER'"
// INTENTION_TEXT: "Add import for 'java.util.regex.Pattern.CASE_INSENSITIVE'"
// WITH_RUNTIME
import javax.swing.SwingConstants
import javax.swing.SwingConstants.CENTER
import java.util.regex.Pattern
import java.util.regex.Pattern.CASE_INSENSITIVE
fun foo() {
val v = CENTER
val v = CASE_INSENSITIVE
<caret>CENTER
<caret>CASE_INSENSITIVE
}
+8 -11
View File
@@ -1,26 +1,23 @@
// INTENTION_TEXT: "Add import for 'javax.swing.SwingUtilities.invokeLater'"
// INTENTION_TEXT: "Add import for 'java.util.regex.Pattern.matches'"
// WITH_RUNTIME
// ERROR: Unresolved reference: SomethingElse
// ERROR: Unresolved reference: somethingElse
// SKIP_ERRORS_AFTER
import javax.swing.SwingUtilities
import java.util.regex.Pattern
fun foo() {
SwingUtilities.<caret>invokeLater {}
Pattern.<caret>matches("", "")
}
fun bar() {
javax.swing.SwingUtilities.invokeLater {
}
Pattern.matches("", "")
javax.swing.SwingUtilities.invokeLater(Runnable {
SwingUtilities.invokeLater { }
})
java.util.regex.Pattern.matches("", "")
SwingUtilities.invokeAndWait { }
Pattern.compile("")
SomethingElse.invokeLater()
SomethingElse.matches("", "")
somethingElse.SwingUtilities.invokeLater()
somethingElse.Pattern.matches("", "")
}
@@ -1,27 +1,24 @@
// INTENTION_TEXT: "Add import for 'javax.swing.SwingUtilities.invokeLater'"
// INTENTION_TEXT: "Add import for 'java.util.regex.Pattern.matches'"
// WITH_RUNTIME
// ERROR: Unresolved reference: SomethingElse
// ERROR: Unresolved reference: somethingElse
// SKIP_ERRORS_AFTER
import javax.swing.SwingUtilities
import javax.swing.SwingUtilities.invokeLater
import java.util.regex.Pattern
import java.util.regex.Pattern.matches
fun foo() {
invokeLater {}
matches("", "")
}
fun bar() {
invokeLater {
}
matches("", "")
invokeLater(Runnable {
invokeLater { }
})
matches("", "")
SwingUtilities.invokeAndWait { }
Pattern.compile("")
SomethingElse.invokeLater()
SomethingElse.matches("", "")
somethingElse.SwingUtilities.invokeLater()
somethingElse.Pattern.matches("", "")
}
@@ -1,9 +1,7 @@
// WITH_RUNTIME
import javax.swing.SwingUtilities
fun bar() {
SwingUtilities.invokeLater(<caret>object: Runnable {
Thread(<caret>object: Runnable {
override fun run() {
throw UnsupportedOperationException()
}
@@ -1,7 +1,5 @@
// WITH_RUNTIME
import javax.swing.SwingUtilities
fun bar() {
SwingUtilities.invokeLater { throw UnsupportedOperationException() }
Thread { throw UnsupportedOperationException() }
}
@@ -1,9 +1,7 @@
// WITH_RUNTIME
import javax.swing.SwingUtilities
fun bar(p: Int) {
SwingUtilities.invokeLater(<caret>object: Runnable {
Thread(<caret>object: Runnable {
override fun run() {
if (p < 0) return
throw UnsupportedOperationException()
@@ -1,9 +1,7 @@
// WITH_RUNTIME
import javax.swing.SwingUtilities
fun bar(p: Int) {
SwingUtilities.invokeLater(Runnable {
Thread(Runnable {
if (p < 0) return@Runnable
throw UnsupportedOperationException()
})
@@ -45,7 +45,7 @@
<problem>
<file>NoSamAdapterNeeded.kt</file>
<line>6</line>
<line>4</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="NoSamAdapterNeeded.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Convert object literal to lambda</problem_class>
@@ -1,6 +1,10 @@
// WITH_RUNTIME
fun getEntry() : Map.Entry<kotlin.Array<String>, java.sql.Array> {
object Holder {
class Array
}
fun getEntry() : Map.Entry<kotlin.Array<String>, Holder.Array> {
throw Error()
}
@@ -1,7 +1,11 @@
// WITH_RUNTIME
fun getEntry() : Map.Entry<kotlin.Array<String>, java.sql.Array> {
object Holder {
class Array
}
fun getEntry() : Map.Entry<kotlin.Array<String>, Holder.Array> {
throw Error()
}
val x: Map.Entry<Array<String>, java.sql.Array> = getEntry()
val x: Map.Entry<Array<String>, Holder.Array> = getEntry()
@@ -1,9 +1,9 @@
// WITH_RUNTIME
// WITH_JDK
// IS_APPLICABLE: false
import java.net.Socket
import java.util.concurrent.atomic.AtomicInteger
fun main(args: Array<String>) {
val s = Socket()
val stream = s.getInputStream()<caret>
val i = AtomicInteger()
val value = i.getAndIncrement()<caret>
}