New J2K: add better support of implicit functional interfaces
#KT-32702 fixed #KT-19327 fixed
This commit is contained in:
@@ -46,6 +46,9 @@ class KtClassBody : KtElementImplStub<KotlinPlaceHolderStub<KtClassBody>>, KtDec
|
||||
val properties: List<KtProperty>
|
||||
get() = getStubOrPsiChildrenAsList(KtStubElementTypes.PROPERTY)
|
||||
|
||||
val functions: List<KtFunction>
|
||||
get() = getStubOrPsiChildrenAsList(KtStubElementTypes.FUNCTION)
|
||||
|
||||
val enumEntries: List<KtEnumEntry>
|
||||
get() = getStubOrPsiChildrenAsList(KtStubElementTypes.ENUM_ENTRY).filterIsInstance<KtEnumEntry>()
|
||||
|
||||
|
||||
@@ -985,7 +985,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
testGroup("nj2k/tests", "nj2k/testData") {
|
||||
testClass<AbstractNewJavaToKotlinConverterSingleFileTest> {
|
||||
model("newJ2k", extension = "java")
|
||||
model("newJ2k", pattern = """^([^\.]+)\.java$""")
|
||||
}
|
||||
testClass<AbstractNewJavaToKotlinCopyPasteConversionTest> {
|
||||
model("copyPaste", pattern = """^([^\.]+)\.java$""")
|
||||
|
||||
@@ -990,7 +990,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
testGroup("nj2k/tests", "nj2k/testData") {
|
||||
testClass<AbstractNewJavaToKotlinConverterSingleFileTest> {
|
||||
model("newJ2k", extension = "java")
|
||||
model("newJ2k", pattern = """^([^\.]+)\.java$""")
|
||||
}
|
||||
testClass<AbstractNewJavaToKotlinCopyPasteConversionTest> {
|
||||
model("copyPaste", pattern = """^([^\.]+)\.java$""")
|
||||
|
||||
@@ -950,7 +950,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
testGroup("nj2k/tests", "nj2k/testData") {
|
||||
testClass<AbstractNewJavaToKotlinConverterSingleFileTest> {
|
||||
model("newJ2k", extension = "java")
|
||||
model("newJ2k", pattern = """^([^\.]+)\.java$""")
|
||||
}
|
||||
testClass<AbstractNewJavaToKotlinCopyPasteConversionTest> {
|
||||
model("copyPaste", pattern = """^([^\.]+)\.java$""")
|
||||
|
||||
@@ -954,7 +954,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
testGroup("nj2k/tests", "nj2k/testData") {
|
||||
testClass<AbstractNewJavaToKotlinConverterSingleFileTest> {
|
||||
model("newJ2k", extension = "java")
|
||||
model("newJ2k", pattern = """^([^\.]+)\.java$""")
|
||||
}
|
||||
testClass<AbstractNewJavaToKotlinCopyPasteConversionTest> {
|
||||
model("copyPaste", pattern = """^([^\.]+)\.java$""")
|
||||
|
||||
@@ -950,19 +950,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
testGroup("nj2k/tests", "nj2k/testData") {
|
||||
testClass<AbstractNewJavaToKotlinConverterSingleFileTest> {
|
||||
model("newJ2k", extension = "java")
|
||||
}
|
||||
testClass<AbstractNewJavaToKotlinCopyPasteConversionTest> {
|
||||
model("copyPaste", pattern = """^([^\.]+)\.java$""")
|
||||
}
|
||||
testClass<AbstractNullabilityAnalysisTest> {
|
||||
model("nullabilityAnalysis")
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("nj2k/tests", "nj2k/testData") {
|
||||
testClass<AbstractNewJavaToKotlinConverterSingleFileTest> {
|
||||
model("newJ2k", extension = "java")
|
||||
model("newJ2k", pattern = """^([^\.]+)\.java$""")
|
||||
}
|
||||
testClass<AbstractNewJavaToKotlinCopyPasteConversionTest> {
|
||||
model("copyPaste", pattern = """^([^\.]+)\.java$""")
|
||||
|
||||
@@ -55,18 +55,20 @@ abstract class AbstractJavaToKotlinConverterTest : KotlinLightCodeInsightFixture
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
private fun addFile(fileName: String, dirName: String) {
|
||||
protected fun addFile(fileName: String, dirName: String? = null) {
|
||||
addFile(File("j2k/testData/$fileName"), dirName)
|
||||
}
|
||||
|
||||
protected fun addFile(file: File, dirName: String): VirtualFile {
|
||||
protected fun addFile(file: File, dirName: String?): VirtualFile {
|
||||
return addFile(FileUtil.loadFile(file, true), file.name, dirName)
|
||||
}
|
||||
|
||||
protected fun addFile(text: String, fileName: String, dirName: String): VirtualFile {
|
||||
protected fun addFile(text: String, fileName: String, dirName: String?): VirtualFile {
|
||||
return runWriteAction {
|
||||
val root = LightPlatformTestCase.getSourceRoot()!!
|
||||
val virtualDir = root.findChild(dirName) ?: root.createChildDirectory(null, dirName)
|
||||
val virtualDir = dirName?.let {
|
||||
root.findChild(it) ?: root.createChildDirectory(null, it)
|
||||
} ?: root
|
||||
val virtualFile = virtualDir.createChildData(null, fileName)
|
||||
virtualFile.getOutputStream(null)!!.writer().use { it.write(text) }
|
||||
virtualFile
|
||||
|
||||
@@ -66,7 +66,6 @@ object ConversionsRunner {
|
||||
+LiteralConversion()
|
||||
+ForConversion(context)
|
||||
+LabeledStatementConversion()
|
||||
+TypeParametersNullabilityConversion()
|
||||
+ArrayOperationsConversion(context)
|
||||
+EqualsOperatorConversion(context)
|
||||
+TypeMappingConversion(context)
|
||||
|
||||
@@ -31,6 +31,8 @@ class JKSymbolProvider(project: Project, module: Module, contextElement: PsiElem
|
||||
|
||||
private fun symbolForNonKotlinElement(psi: PsiElement) =
|
||||
when (psi) {
|
||||
is PsiTypeParameter -> JKMultiverseTypeParameterSymbol(psi, this)
|
||||
is KtTypeParameter -> JKMultiverseKtTypeParameterSymbol(psi, this)
|
||||
is KtEnumEntry -> JKMultiverseKtEnumEntrySymbol(psi, this)
|
||||
is PsiClass -> JKMultiverseClassSymbol(psi, this)
|
||||
is KtClassOrObject -> JKMultiverseKtClassSymbol(psi, this)
|
||||
@@ -55,7 +57,7 @@ class JKSymbolProvider(project: Project, module: Module, contextElement: PsiElem
|
||||
}
|
||||
}
|
||||
|
||||
internal inline fun <reified T : JKSymbol> provideSymbol(reference: PsiReference): T {
|
||||
internal inline fun <reified T : JKSymbol> provideSymbolForReference(reference: PsiReference): T {
|
||||
val target = reference.resolve()
|
||||
if (target != null) return provideDirectSymbol(target) as T
|
||||
return (if (isAssignable<T, JKUnresolvedField>()) JKUnresolvedField(
|
||||
@@ -69,6 +71,7 @@ class JKSymbolProvider(project: Project, module: Module, contextElement: PsiElem
|
||||
is JKUniverseClassSymbol -> it.target = jk as JKClass
|
||||
is JKUniverseFieldSymbol -> it.target = jk as JKVariable
|
||||
is JKUniverseMethodSymbol -> it.target = jk as JKMethod
|
||||
is JKUniverseTypeParameterSymbol -> it.target = jk as JKTypeParameter
|
||||
}
|
||||
symbolsByJK[jk] = it
|
||||
}
|
||||
@@ -78,6 +81,7 @@ class JKSymbolProvider(project: Project, module: Module, contextElement: PsiElem
|
||||
when (psi) {
|
||||
is PsiVariable -> JKUniverseFieldSymbol(this)
|
||||
is PsiMethod -> JKUniverseMethodSymbol(this)
|
||||
is PsiTypeParameter -> JKUniverseTypeParameterSymbol(this)
|
||||
is PsiClass -> JKUniverseClassSymbol(this)
|
||||
else -> TODO()
|
||||
}
|
||||
@@ -165,6 +169,10 @@ class JKSymbolProvider(project: Project, module: Module, contextElement: PsiElem
|
||||
enumConstant.acceptChildren(this)
|
||||
}
|
||||
|
||||
override fun visitTypeParameter(classParameter: PsiTypeParameter) {
|
||||
provideUniverseSymbol(classParameter)
|
||||
}
|
||||
|
||||
override fun visitFile(file: PsiFile) {
|
||||
file.acceptChildren(this)
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.jetbrains.kotlin.idea.refactoring.fqName.getKotlinFqName
|
||||
import org.jetbrains.kotlin.j2k.ReferenceSearcher
|
||||
import org.jetbrains.kotlin.j2k.ast.Nullability
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||
import org.jetbrains.kotlin.nj2k.tree.*
|
||||
import org.jetbrains.kotlin.nj2k.tree.JKLiteralExpression.LiteralType.*
|
||||
import org.jetbrains.kotlin.nj2k.tree.impl.*
|
||||
@@ -355,14 +356,13 @@ class JavaToJKTreeBuilder constructor(
|
||||
it.assignNonCodeElements(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun PsiFunctionalExpression.functionalType(): JKTypeElement =
|
||||
functionalInterfaceType?.toJK(symbolProvider)?.takeIf { type ->
|
||||
type.safeAs<JKClassType>()?.classReference is JKMultiverseClassSymbol
|
||||
functionalInterfaceType?.toJK(symbolProvider)?.takeUnless { type ->
|
||||
type.isKotlinFunctionType
|
||||
}?.asTypeElement() ?: JKTypeElementImpl(JKNoTypeImpl)
|
||||
|
||||
fun PsiMethodReferenceExpression.toJK(): JKMethodReferenceExpression {
|
||||
val symbol = symbolProvider.provideSymbol<JKNamedSymbol>(this).let { symbol ->
|
||||
val symbol = symbolProvider.provideSymbolForReference<JKNamedSymbol>(this).let { symbol ->
|
||||
when {
|
||||
symbol.isUnresolved() && isConstructor -> JKUnresolvedClassSymbol(qualifier?.text ?: text)
|
||||
symbol.isUnresolved() && !isConstructor -> JKUnresolvedMethod(referenceName ?: text)
|
||||
@@ -391,7 +391,7 @@ class JavaToJKTreeBuilder constructor(
|
||||
return qualifierExpression?.toJK() ?: JKStubExpressionImpl()
|
||||
}
|
||||
|
||||
val symbol = symbolProvider.provideSymbol<JKSymbol>(this)
|
||||
val symbol = symbolProvider.provideSymbolForReference<JKSymbol>(this)
|
||||
return when (symbol) {
|
||||
is JKClassSymbol -> JKClassAccessExpressionImpl(symbol)
|
||||
is JKFieldSymbol -> JKFieldAccessExpressionImpl(symbol)
|
||||
@@ -526,6 +526,7 @@ class JavaToJKTreeBuilder constructor(
|
||||
nameIdentifier.toJK(),
|
||||
extendsListTypes.map { JKTypeElementImpl(it.toJK(symbolProvider, Nullability.Default)) }
|
||||
).also {
|
||||
symbolProvider.provideUniverseSymbol(this, it)
|
||||
it.assignNonCodeElements(this)
|
||||
}
|
||||
|
||||
@@ -656,7 +657,7 @@ class JavaToJKTreeBuilder constructor(
|
||||
|
||||
fun PsiAnnotation.toJK(): JKAnnotation =
|
||||
JKAnnotationImpl(
|
||||
symbolProvider.provideSymbol<JKSymbol>(nameReferenceElement!!).safeAs<JKClassSymbol>()
|
||||
symbolProvider.provideSymbolForReference<JKSymbol>(nameReferenceElement!!).safeAs<JKClassSymbol>()
|
||||
?: JKUnresolvedClassSymbol(nameReferenceElement!!.text),
|
||||
parameterList.attributes.map { parameter ->
|
||||
if (parameter.nameIdentifier != null) {
|
||||
|
||||
@@ -956,7 +956,7 @@ private class JKPrinter(
|
||||
is JKStarProjectionType ->
|
||||
printWithNoIndent("*")
|
||||
is JKTypeParameterType ->
|
||||
printWithNoIndent(type.name)
|
||||
printWithNoIndent(type.identifier.name)
|
||||
is JKVarianceTypeParameterType -> {
|
||||
when (type.variance) {
|
||||
JKVarianceTypeParameterType.Variance.IN -> printWithNoIndent("in ")
|
||||
|
||||
+53
-12
@@ -5,11 +5,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.nj2k.conversions
|
||||
|
||||
import com.intellij.lang.jvm.JvmModifier
|
||||
import org.jetbrains.kotlin.nj2k.NewJ2kConverterContext
|
||||
import org.jetbrains.kotlin.nj2k.nullIfStubExpression
|
||||
import org.jetbrains.kotlin.nj2k.qualified
|
||||
import org.jetbrains.kotlin.nj2k.tree.*
|
||||
import org.jetbrains.kotlin.nj2k.tree.impl.*
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
|
||||
@@ -18,10 +20,34 @@ class MethodReferenceToLambdaConversion(private val context: NewJ2kConverterCont
|
||||
if (element !is JKMethodReferenceExpression) return recurse(element)
|
||||
val symbol = element.identifier
|
||||
|
||||
val parametersTypesByFunctionalInterface = element
|
||||
.functionalType
|
||||
.type
|
||||
.safeAs<JKClassType>()
|
||||
?.singleFunctionParameterTypes()
|
||||
|
||||
val receiverParameter = element.qualifier
|
||||
.nullIfStubExpression()
|
||||
?.safeAs<JKClassAccessExpression>()
|
||||
?.takeIf { symbol.safeAs<JKMethodSymbol>()?.isStatic == false && !element.isConstructorCall }
|
||||
?.let { classAccessExpression ->
|
||||
JKParameterImpl(
|
||||
JKTypeElementImpl(
|
||||
parametersTypesByFunctionalInterface?.firstOrNull() ?: JKClassTypeImpl(classAccessExpression.identifier)
|
||||
),
|
||||
JKNameIdentifierImpl(RECEIVER_NAME),
|
||||
isVarArgs = false
|
||||
)
|
||||
}
|
||||
|
||||
val explicitParameterTypesByFunctionalInterface =
|
||||
if (receiverParameter != null) parametersTypesByFunctionalInterface?.drop(1)
|
||||
else parametersTypesByFunctionalInterface
|
||||
|
||||
val parameters =
|
||||
if (symbol is JKMethodSymbol) {
|
||||
(symbol.parameterNames ?: return recurse(element)).zip(
|
||||
symbol.parameterTypes ?: return recurse(element)
|
||||
explicitParameterTypesByFunctionalInterface ?: symbol.parameterTypes ?: return recurse(element)
|
||||
) { name, type ->
|
||||
JKParameterImpl(
|
||||
JKTypeElementImpl(type),
|
||||
@@ -31,17 +57,6 @@ class MethodReferenceToLambdaConversion(private val context: NewJ2kConverterCont
|
||||
}
|
||||
} else emptyList()
|
||||
|
||||
val receiverParameter = element.qualifier
|
||||
.nullIfStubExpression()
|
||||
?.safeAs<JKClassAccessExpression>()
|
||||
?.takeIf { symbol.safeAs<JKMethodSymbol>()?.isStatic == false && !element.isConstructorCall }
|
||||
?.let { classAccessExpression ->
|
||||
JKParameterImpl(
|
||||
JKTypeElementImpl(JKClassTypeImpl(classAccessExpression.identifier)),
|
||||
JKNameIdentifierImpl(RECEIVER_NAME),
|
||||
isVarArgs = false
|
||||
)
|
||||
}
|
||||
val arguments = parameters.map { parameter ->
|
||||
val parameterSymbol = context.symbolProvider.provideUniverseSymbol(parameter)
|
||||
JKArgumentImpl(JKFieldAccessExpressionImpl(parameterSymbol))
|
||||
@@ -82,6 +97,32 @@ class MethodReferenceToLambdaConversion(private val context: NewJ2kConverterCont
|
||||
return recurse(lambda)
|
||||
}
|
||||
|
||||
private fun JKType.substituteTypeParameters(classType: JKClassType) = applyRecursive { type ->
|
||||
if (type is JKTypeParameterType && type.identifier.declaredIn == classType.classReference)
|
||||
classType.parameters.getOrNull(type.identifier.index)
|
||||
else null
|
||||
}
|
||||
|
||||
|
||||
private fun JKClassType.singleFunctionParameterTypes(): List<JKType>? {
|
||||
return when (val reference = classReference) {
|
||||
is JKMultiverseClassSymbol -> reference.target.methods
|
||||
.firstOrNull { !it.hasModifier(JvmModifier.STATIC) }
|
||||
?.parameterList
|
||||
?.parameters
|
||||
?.map { it.type.toJK(context.symbolProvider).substituteTypeParameters(this) }
|
||||
is JKMultiverseKtClassSymbol -> reference.target.body
|
||||
?.functions
|
||||
?.singleOrNull()
|
||||
?.valueParameters
|
||||
?.map { it.typeReference?.toJK(context.symbolProvider)?.substituteTypeParameters(this) ?: return null }
|
||||
is JKUniverseClassSymbol -> reference.target.classBody.declarations.firstIsInstanceOrNull<JKMethod>()
|
||||
?.parameters
|
||||
?.map { it.type.type.substituteTypeParameters(this) }
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val RECEIVER_NAME = "obj" //name taken from old j2k
|
||||
}
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.nj2k.conversions
|
||||
|
||||
import org.jetbrains.kotlin.j2k.ast.Nullability
|
||||
import org.jetbrains.kotlin.nj2k.tree.*
|
||||
import org.jetbrains.kotlin.nj2k.tree.impl.*
|
||||
|
||||
|
||||
class TypeParametersNullabilityConversion : RecursiveApplicableConversionBase() {
|
||||
override fun applyToElement(element: JKTreeElement): JKTreeElement {
|
||||
if (element !is JKTypeParameterList) return recurse(element)
|
||||
val typeParametersNullabilityMap =
|
||||
element.typeParameters.map { typeParameter ->
|
||||
typeParameter.name.value to typeParameter.hasNullableUpperBounds()
|
||||
}.toMap()
|
||||
return JKTypeParameterListImpl(
|
||||
element.typeParameters.map { typeParameter ->
|
||||
val name = typeParameter.name.value
|
||||
JKTypeParameterImpl(
|
||||
JKNameIdentifierImpl(name),
|
||||
typeParameter.upperBounds.map { upperBoundTypeElement ->
|
||||
JKTypeElementImpl(
|
||||
upperBoundTypeElement.type.makeTypeParametersNotNull(typeParametersNullabilityMap)
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun JKType.makeTypeParametersNotNull(nullabilityMap: Map<String, Boolean>): JKType =
|
||||
when (this) {
|
||||
is JKClassType ->
|
||||
JKClassTypeImpl(
|
||||
classReference,
|
||||
parameters.map { it.makeTypeParametersNotNull(nullabilityMap) },
|
||||
nullability
|
||||
)
|
||||
is JKTypeParameterType ->
|
||||
nullabilityMap[name]
|
||||
?.takeIf { nullability == Nullability.Default }
|
||||
?.let { isNullable ->
|
||||
JKTypeParameterTypeImpl(
|
||||
name,
|
||||
if (isNullable) Nullability.NotNull else Nullability.Nullable
|
||||
)
|
||||
} ?: this
|
||||
|
||||
is JKVarianceTypeParameterType ->
|
||||
JKVarianceTypeParameterTypeImpl(
|
||||
variance,
|
||||
boundType.makeTypeParametersNotNull(nullabilityMap)
|
||||
)
|
||||
else -> this
|
||||
}
|
||||
|
||||
private fun JKTypeParameter.hasNullableUpperBounds(): Boolean =
|
||||
upperBounds.any { it.type.isNullable() }
|
||||
}
|
||||
@@ -214,17 +214,11 @@ object JKNoTypeImpl : JKNoType {
|
||||
|
||||
class JKStarProjectionTypeImpl : JKStarProjectionType
|
||||
|
||||
fun JKType.fqName(): String =
|
||||
when (this) {
|
||||
is JKClassType -> {
|
||||
when (val target = classReference.target) {
|
||||
is KtClass -> target.fqName?.asString() ?: throw RuntimeException("FqName can not be calculated")
|
||||
is PsiClass -> target.qualifiedName ?: throw RuntimeException("FqName can not be calculated")
|
||||
else -> TODO(target.toString())
|
||||
}
|
||||
}
|
||||
val JKType.fqName: String?
|
||||
get() = when (this) {
|
||||
is JKClassType -> classReference.fqName
|
||||
is JKJavaPrimitiveType -> jvmPrimitiveType.name
|
||||
else -> TODO(toString())
|
||||
else -> null
|
||||
}
|
||||
|
||||
class JKNullLiteral : JKLiteralExpression, JKElementBase(), PsiOwner by PsiOwnerImpl() {
|
||||
@@ -481,7 +475,7 @@ class JKTypeParameterListImpl(typeParameters: List<JKTypeParameter> = emptyList(
|
||||
override fun accept(visitor: JKVisitor) = visitor.visitTypeParameterList(this)
|
||||
}
|
||||
|
||||
class JKTypeParameterImpl(name: JKNameIdentifier, upperBounds: List<JKTypeElement>) : JKTypeParameter, JKBranchElementBase() {
|
||||
class JKTypeParameterImpl(name: JKNameIdentifier, upperBounds: List<JKTypeElement>) : JKTypeParameter() {
|
||||
override var name: JKNameIdentifier by child(name)
|
||||
override var upperBounds: List<JKTypeElement> by children(upperBounds)
|
||||
override fun accept(visitor: JKVisitor) = visitor.visitTypeParameter(this)
|
||||
@@ -493,7 +487,7 @@ data class JKVarianceTypeParameterTypeImpl(
|
||||
) : JKVarianceTypeParameterType
|
||||
|
||||
data class JKTypeParameterTypeImpl(
|
||||
override val name: String,
|
||||
override val identifier: JKTypeParameterSymbol,
|
||||
override val nullability: Nullability = Nullability.Default
|
||||
) : JKTypeParameterType
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.nj2k.parentOfType
|
||||
import org.jetbrains.kotlin.nj2k.tree.*
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.containingClass
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
interface JKSymbol {
|
||||
@@ -317,4 +318,48 @@ fun JKSymbol.deepestFqName(): String? {
|
||||
else -> null
|
||||
}
|
||||
return target.deepestFqNameForTarget() ?: fqName
|
||||
}
|
||||
|
||||
interface JKTypeParameterSymbol : JKSymbol {
|
||||
val index: Int
|
||||
val name: String
|
||||
}
|
||||
|
||||
class JKMultiverseTypeParameterSymbol(
|
||||
override val target: PsiTypeParameter,
|
||||
private val symbolProvider: JKSymbolProvider
|
||||
) : JKTypeParameterSymbol {
|
||||
override val declaredIn: JKSymbol?
|
||||
get() = target.owner?.let { symbolProvider.provideDirectSymbol(it) }
|
||||
override val fqName: String
|
||||
get() = target.getKotlinFqName()?.asString()!!
|
||||
override val index: Int
|
||||
get() = target.index
|
||||
override val name: String
|
||||
get() = target.name!!
|
||||
}
|
||||
|
||||
class JKUniverseTypeParameterSymbol(
|
||||
override val symbolProvider: JKSymbolProvider
|
||||
) : JKTypeParameterSymbol, JKUniverseSymbol<JKTypeParameter>() {
|
||||
override val index: Int
|
||||
get() = declaredIn?.safeAs<JKTypeParameterListOwner>()?.typeParameterList?.typeParameters?.indexOf(target) ?: -1
|
||||
override val name: String
|
||||
get() = target.name.value
|
||||
override lateinit var target: JKTypeParameter
|
||||
}
|
||||
|
||||
class JKMultiverseKtTypeParameterSymbol(
|
||||
override val target: KtTypeParameter,
|
||||
private val symbolProvider: JKSymbolProvider
|
||||
) : JKTypeParameterSymbol {
|
||||
override val declaredIn: JKSymbol?
|
||||
get() = target.getParentOfType<KtTypeParameterListOwner>(strict = false)
|
||||
?.let { symbolProvider.provideDirectSymbol(it) }
|
||||
override val fqName: String
|
||||
get() = target.getKotlinFqName()?.asString()!!
|
||||
override val index: Int
|
||||
get() = target.getParentOfType<KtTypeParameterListOwner>(strict = false)?.typeParameters?.indexOf(target) ?: -1
|
||||
override val name: String
|
||||
get() = target.name!!
|
||||
}
|
||||
@@ -486,9 +486,9 @@ interface JKTypeParameterList : JKTreeElement {
|
||||
var typeParameters: List<JKTypeParameter>
|
||||
}
|
||||
|
||||
interface JKTypeParameter : JKTreeElement {
|
||||
var name: JKNameIdentifier
|
||||
var upperBounds: List<JKTypeElement>
|
||||
abstract class JKTypeParameter : JKDeclaration() {
|
||||
abstract var name: JKNameIdentifier
|
||||
abstract var upperBounds: List<JKTypeElement>
|
||||
}
|
||||
|
||||
interface JKTypeParameterListOwner : JKTreeElement {
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.nj2k.tree
|
||||
import org.jetbrains.kotlin.j2k.ast.Nullability
|
||||
import org.jetbrains.kotlin.nj2k.tree.impl.JKBranchElementBase
|
||||
import org.jetbrains.kotlin.nj2k.tree.impl.JKClassSymbol
|
||||
import org.jetbrains.kotlin.nj2k.tree.impl.JKTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType
|
||||
import kotlin.jvm.internal.CallableReference
|
||||
import kotlin.reflect.KProperty0
|
||||
@@ -72,7 +73,7 @@ interface JKVarianceTypeParameterType : JKType {
|
||||
}
|
||||
|
||||
interface JKTypeParameterType : JKType {
|
||||
val name: String
|
||||
val identifier: JKTypeParameterSymbol
|
||||
}
|
||||
|
||||
interface JKNoType : JKType
|
||||
|
||||
@@ -8,16 +8,21 @@ package org.jetbrains.kotlin.nj2k.tree
|
||||
import com.intellij.psi.*
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.builtins.PrimitiveType
|
||||
import org.jetbrains.kotlin.builtins.getFunctionalClassKind
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaClassDescriptor
|
||||
import org.jetbrains.kotlin.j2k.ast.Nullability
|
||||
import org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName
|
||||
import org.jetbrains.kotlin.js.resolve.diagnostics.findPsi
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||
import org.jetbrains.kotlin.nj2k.JKSymbolProvider
|
||||
import org.jetbrains.kotlin.nj2k.kotlinTypeByName
|
||||
import org.jetbrains.kotlin.nj2k.tree.impl.*
|
||||
import org.jetbrains.kotlin.psi.KtClass
|
||||
import org.jetbrains.kotlin.psi.KtTypeParameter
|
||||
import org.jetbrains.kotlin.psi.KtTypeReference
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType
|
||||
@@ -88,7 +93,7 @@ fun PsiType.toJK(symbolProvider: JKSymbolProvider, nullability: Nullability = Nu
|
||||
null ->
|
||||
JKClassTypeImpl(JKUnresolvedClassSymbol(rawType().canonicalText), parameters, nullability)
|
||||
is PsiTypeParameter ->
|
||||
JKTypeParameterTypeImpl(target.name!!)
|
||||
JKTypeParameterTypeImpl(symbolProvider.provideDirectSymbol(target) as JKTypeParameterSymbol)
|
||||
else -> {
|
||||
JKClassTypeImpl(
|
||||
target.let { symbolProvider.provideDirectSymbol(it) as JKClassSymbol },
|
||||
@@ -133,12 +138,28 @@ fun JKType.isSubtypeOf(other: JKType, symbolProvider: JKSymbolProvider): Boolean
|
||||
?.let { otherType -> this.toKtType(symbolProvider)?.isSubtypeOf(otherType) } == true
|
||||
|
||||
|
||||
fun KotlinType.toJK(symbolProvider: JKSymbolProvider): JKClassTypeImpl =
|
||||
JKClassTypeImpl(
|
||||
symbolProvider.provideClassSymbol(getJetTypeFqName(false)),
|
||||
arguments.map { it.type.toJK(symbolProvider) },
|
||||
if (isNullable()) Nullability.Nullable else Nullability.NotNull
|
||||
)
|
||||
fun KotlinType.toJK(symbolProvider: JKSymbolProvider): JKType {
|
||||
return when (val descriptor = constructor.declarationDescriptor) {
|
||||
is TypeParameterDescriptor ->
|
||||
JKTypeParameterTypeImpl(
|
||||
symbolProvider.provideDirectSymbol(descriptor.findPsi() as? KtTypeParameter ?: return JKNoTypeImpl) as JKTypeParameterSymbol
|
||||
)
|
||||
|
||||
else -> JKClassTypeImpl(
|
||||
symbolProvider.provideClassSymbol(getJetTypeFqName(false)),
|
||||
arguments.map { it.type.toJK(symbolProvider) },
|
||||
if (isNullable()) Nullability.Nullable else Nullability.NotNull
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val JKType.isKotlinFunctionType: Boolean
|
||||
get() {
|
||||
val fqName = safeAs<JKClassType>()?.fqName ?: return false
|
||||
return functionalTypeRegex.matches(fqName)
|
||||
}
|
||||
|
||||
private val functionalTypeRegex = """(kotlin\.jvm\.functions|kotlin)\.Function[\d+]""".toRegex()
|
||||
|
||||
|
||||
fun KtTypeReference.toJK(symbolProvider: JKSymbolProvider): JKType? =
|
||||
@@ -213,7 +234,7 @@ fun JKType.applyRecursive(transform: (JKType) -> JKType?): JKType =
|
||||
inline fun <reified T : JKType> T.updateNullability(newNullability: Nullability): T =
|
||||
if (nullability == newNullability) this
|
||||
else when (this) {
|
||||
is JKTypeParameterTypeImpl -> JKTypeParameterTypeImpl(name, newNullability)
|
||||
is JKTypeParameterTypeImpl -> JKTypeParameterTypeImpl(identifier, newNullability)
|
||||
is JKClassTypeImpl -> JKClassTypeImpl(classReference, parameters, newNullability)
|
||||
is JKNoType -> this
|
||||
is JKJavaVoidType -> this
|
||||
@@ -228,7 +249,7 @@ inline fun <reified T : JKType> T.updateNullability(newNullability: Nullability)
|
||||
fun <T : JKType> T.updateNullabilityRecursively(newNullability: Nullability): T =
|
||||
applyRecursive {
|
||||
when (it) {
|
||||
is JKTypeParameterTypeImpl -> JKTypeParameterTypeImpl(it.name, newNullability)
|
||||
is JKTypeParameterTypeImpl -> JKTypeParameterTypeImpl(it.identifier, newNullability)
|
||||
is JKClassTypeImpl ->
|
||||
JKClassTypeImpl(
|
||||
it.classReference,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
interface FunctionalI<A, B> {
|
||||
B apply(A x);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
<A, B> B foo(A value, FunctionalI<A, B> fun) {
|
||||
return fun.apply(value);
|
||||
}
|
||||
|
||||
Double toDouble(Integer x) {
|
||||
return x.doubleValue();
|
||||
}
|
||||
|
||||
public double nya() {
|
||||
return foo(1, this::toDouble);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
internal class Test {
|
||||
fun <A, B> foo(value: A, `fun`: FunctionalI<A, B>): B {
|
||||
return `fun`.apply(value)
|
||||
}
|
||||
|
||||
fun toDouble(x: Int): Double {
|
||||
return x.toDouble()
|
||||
}
|
||||
|
||||
fun nya(): Double {
|
||||
return foo(1, FunctionalI { x: Int -> this.toDouble(x) })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
interface FunctionalI<A, B> {
|
||||
fun apply(x: A): B
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class Test {
|
||||
<A, B> B foo(A value, FunctionalI<A, B> fun) {
|
||||
return fun.apply(value);
|
||||
}
|
||||
|
||||
Double toDouble(Integer x) {
|
||||
return x.doubleValue();
|
||||
}
|
||||
|
||||
public double nya() {
|
||||
//TODO explicitlly call apply here
|
||||
return foo(1, this::toDouble);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ERROR: Interface FunctionalI does not have constructors
|
||||
internal class Test {
|
||||
fun <A, B> foo(value: A, `fun`: FunctionalI<A, B>): B {
|
||||
return `fun`.apply(value)
|
||||
}
|
||||
|
||||
fun toDouble(x: Int): Double {
|
||||
return x.toDouble()
|
||||
}
|
||||
|
||||
fun nya(): Double {
|
||||
//TODO explicitlly call apply here
|
||||
|
||||
return foo(1, FunctionalI<Int, Double> { x: Int -> this.toDouble(x) })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
interface FunctionalI<A, B> {
|
||||
B apply(A x);
|
||||
}
|
||||
|
||||
class Test {
|
||||
<A, B> B foo(A value, FunctionalI<A, B> fun) {
|
||||
return fun.apply(value);
|
||||
}
|
||||
|
||||
Double toDouble(Integer x) {
|
||||
return x.doubleValue();
|
||||
}
|
||||
|
||||
public double nya() {
|
||||
return foo(1, this::toDouble);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// ERROR: Type mismatch: inferred type is B? but B was expected
|
||||
// ERROR: Unresolved reference: A
|
||||
// ERROR: Interface FunctionalI does not have constructors
|
||||
internal interface FunctionalI<A, B> {
|
||||
fun apply(x: A): B
|
||||
}
|
||||
|
||||
internal class Test {
|
||||
fun <A, B> foo(value: A, `fun`: FunctionalI<A?, B?>): B {
|
||||
return `fun`.apply(value)
|
||||
}
|
||||
|
||||
fun toDouble(x: Int): Double {
|
||||
return x.toDouble()
|
||||
}
|
||||
|
||||
fun nya(): Double {
|
||||
return foo(1, FunctionalI<Int, Double> { x: A -> this.toDouble(x) })
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// RUNTIME_WITH_FULL_JDK
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
class JavaCode {
|
||||
public String toJSON(Collection<Integer> collection) {
|
||||
return "[" + collection.stream().map(Object::toString).collect(Collectors.joining(", ")) + "]";
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// ERROR: Unresolved reference: stream
|
||||
// ERROR: Unresolved reference: stream
|
||||
// ERROR: Unresolved reference: Collectors
|
||||
import java.util.stream.Collectors
|
||||
|
||||
internal class JavaCode {
|
||||
fun toJSON(collection: Collection<Int?>): String {
|
||||
return "[" + collection.stream().map({ obj: Object -> obj.toString() }).collect(Collectors.joining(", ")).toString() + "]"
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// RUNTIME_WITH_FULL_JDK
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
public void context() {
|
||||
List<Double> items = new ArrayList<>();
|
||||
items.add(1.0);
|
||||
items.forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import java.util.ArrayList
|
||||
import java.util.function.Consumer
|
||||
|
||||
internal class Test {
|
||||
fun context() {
|
||||
val items: MutableList<Double> = ArrayList()
|
||||
items.add(1.0)
|
||||
items.forEach(Consumer { o: Double -> println(o) })
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
fun <T, K> max(coll: Collection<T?>?): T? where T : Any?, T : Comparable<T>?, K : Node?, K : Collection<in K>? {}
|
||||
fun <T, K> max(coll: Collection<T?>?): T? where T : Any?, T : Comparable<T?>?, K : Node?, K : Collection<in K>? {}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
fun <T> max(coll: Collection<T?>?): T? where T : Any?, T : Comparable<T>? {}
|
||||
fun <T> max(coll: Collection<T?>?): T? where T : Any?, T : Comparable<T?>? {}
|
||||
+12
@@ -34,6 +34,18 @@ import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractNewJavaToKotlinConverterSingleFileTest : AbstractJavaToKotlinConverterSingleFileTest() {
|
||||
override fun doTest(javaPath: String) {
|
||||
val directory = File(javaPath).parentFile
|
||||
val expectedFileName = "${File(javaPath).nameWithoutExtension}.external"
|
||||
val expectedFiles = directory.listFiles { _, name ->
|
||||
name == "$expectedFileName.kt" || name == "$expectedFileName.java"
|
||||
}!!.filterNotNull()
|
||||
for (expectedFile in expectedFiles) {
|
||||
addFile(expectedFile, dirName = null)
|
||||
}
|
||||
super.doTest(javaPath)
|
||||
}
|
||||
|
||||
override fun compareResults(expectedFile: File, actual: String) {
|
||||
KotlinTestUtils.assertEqualsToFile(expectedFile, actual) {
|
||||
val file = createKotlinFile(it)
|
||||
|
||||
+101
-76
@@ -26,7 +26,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInNewJ2k() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("nj2k/testData/newJ2k/annotations")
|
||||
@@ -38,7 +38,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInAnnotations() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/annotations"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/annotations"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("annotationArrayArgument.java")
|
||||
@@ -146,7 +146,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInAnonymousBlock() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/anonymousBlock"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/anonymousBlock"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("oneAnonBlock.java")
|
||||
@@ -169,7 +169,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInAnonymousClass() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/anonymousClass"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/anonymousClass"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("kt-13146.java")
|
||||
@@ -192,7 +192,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInArrayAccessExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/arrayAccessExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/arrayAccessExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("expressionIndex.java")
|
||||
@@ -220,7 +220,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInArrayInitializerExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/arrayInitializerExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/arrayInitializerExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("doubleArray.java")
|
||||
@@ -293,7 +293,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInArrayType() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/arrayType"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/arrayType"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayInitializationStatement.java")
|
||||
@@ -356,7 +356,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInAssertStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/assertStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/assertStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("assertNotNull.java")
|
||||
@@ -394,7 +394,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInAssignmentExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/assignmentExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/assignmentExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("and.java")
|
||||
@@ -497,7 +497,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBinaryExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/binaryExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/binaryExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("and.java")
|
||||
@@ -610,7 +610,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBlocks() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/blocks"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/blocks"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("Blocks.java")
|
||||
@@ -628,7 +628,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBoxedType() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/boxedType"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/boxedType"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("boolean.java")
|
||||
@@ -696,7 +696,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBreakStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/breakStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/breakStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("breakWithLabel.java")
|
||||
@@ -719,7 +719,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCallChainExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/callChainExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/callChainExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("libraryFieldCall.java")
|
||||
@@ -772,7 +772,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInClass() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/class"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/class"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousClass.java")
|
||||
@@ -950,7 +950,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInClassExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/classExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/classExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("complexExample.java")
|
||||
@@ -983,7 +983,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInComments() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/comments"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/comments"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("commentInsideCall.java")
|
||||
@@ -1031,7 +1031,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInConditionalExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/conditionalExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/conditionalExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("multiline.java")
|
||||
@@ -1064,7 +1064,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInConstructors() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/constructors"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/constructors"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("artificialPrimary.java")
|
||||
@@ -1272,7 +1272,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInContinueStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/continueStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/continueStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("continueWithLabel.java")
|
||||
@@ -1295,7 +1295,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInDeclarationStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/declarationStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/declarationStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("multiplyFinalIntDeclaration.java")
|
||||
@@ -1353,7 +1353,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInDetectProperties() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/detectProperties"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/detectProperties"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("AnonymousClass.java")
|
||||
@@ -1591,7 +1591,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInDoWhileStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/doWhileStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/doWhileStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("whileWithAssignmentAsExpression.java")
|
||||
@@ -1634,7 +1634,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInDocComments() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/docComments"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/docComments"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("deprecatedDocTag.java")
|
||||
@@ -1717,7 +1717,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInEnum() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/enum"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/enum"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("colorEnum.java")
|
||||
@@ -1820,7 +1820,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInEquals() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/equals"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/equals"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("EqOperator.java")
|
||||
@@ -1863,7 +1863,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInField() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/field"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/field"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classChildExtendsBase.java")
|
||||
@@ -1941,7 +1941,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFor() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/for"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/for"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayIndicesReversed.java")
|
||||
@@ -2174,7 +2174,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInForeachStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/foreachStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/foreachStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("enhancedForWithBlock.java")
|
||||
@@ -2217,7 +2217,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFormatting() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/formatting"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/formatting"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("chainedCall.java")
|
||||
@@ -2270,7 +2270,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunction() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/function"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/function"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classGenericParam.java")
|
||||
@@ -2288,6 +2288,16 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
runTest("nj2k/testData/newJ2k/function/extendsBaseWhichExtendsObject.java");
|
||||
}
|
||||
|
||||
@TestMetadata("externalFunctionalInterface.java")
|
||||
public void testExternalFunctionalInterface() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/function/externalFunctionalInterface.java");
|
||||
}
|
||||
|
||||
@TestMetadata("externalKtFunctionalInterface.java")
|
||||
public void testExternalKtFunctionalInterface() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/function/externalKtFunctionalInterface.java");
|
||||
}
|
||||
|
||||
@TestMetadata("final.java")
|
||||
public void testFinal() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/function/final.java");
|
||||
@@ -2303,6 +2313,11 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
runTest("nj2k/testData/newJ2k/function/internal.java");
|
||||
}
|
||||
|
||||
@TestMetadata("internalFunctionalInterface.java")
|
||||
public void testInternalFunctionalInterface() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/function/internalFunctionalInterface.java");
|
||||
}
|
||||
|
||||
@TestMetadata("java8Lambdas.java")
|
||||
public void testJava8Lambdas() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/function/java8Lambdas.java");
|
||||
@@ -2453,7 +2468,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInIdentifier() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/identifier"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/identifier"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("finalFieldReference.java")
|
||||
@@ -2481,7 +2496,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInIfStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/ifStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/ifStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("assignmentAsExpressionInIf.java")
|
||||
@@ -2534,7 +2549,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInImportStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/importStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/importStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("importWithKeywords.java")
|
||||
@@ -2572,7 +2587,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInheritance() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/inheritance"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/inheritance"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classOneExtendsBaseGeneric.java")
|
||||
@@ -2610,7 +2625,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInIsOperator() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/isOperator"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/isOperator"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("complicatedExpression.java")
|
||||
@@ -2638,7 +2653,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInIssues() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/issues"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/issues"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayLength.java")
|
||||
@@ -2701,6 +2716,11 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-19296.java");
|
||||
}
|
||||
|
||||
@TestMetadata("kt-19327.java")
|
||||
public void testKt_19327() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-19327.java");
|
||||
}
|
||||
|
||||
@TestMetadata("kt-19336.java")
|
||||
public void testKt_19336() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-19336.java");
|
||||
@@ -2876,6 +2896,11 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-32436.java");
|
||||
}
|
||||
|
||||
@TestMetadata("kt-32702.java")
|
||||
public void testKt_32702() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-32702.java");
|
||||
}
|
||||
|
||||
@TestMetadata("kt-5294.java")
|
||||
public void testKt_5294() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-5294.java");
|
||||
@@ -3061,7 +3086,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKotlinApiAccess() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/kotlinApiAccess"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/kotlinApiAccess"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("ClassObjectMembers.java")
|
||||
@@ -3169,7 +3194,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInLabelStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/labelStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/labelStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("complicatedExampleFromJavaTutorial.java")
|
||||
@@ -3187,7 +3212,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInList() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/list"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/list"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("ForEach.java")
|
||||
@@ -3210,7 +3235,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInLiteralExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/literalExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/literalExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("char.java")
|
||||
@@ -3303,7 +3328,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInLocalVariable() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/localVariable"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/localVariable"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("autoBangBang.java")
|
||||
@@ -3361,7 +3386,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInMethodCallExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/methodCallExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/methodCallExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("callWithKeywords.java")
|
||||
@@ -3439,7 +3464,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInMisc() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/misc"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/misc"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("packageWithClass.java")
|
||||
@@ -3482,7 +3507,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInMutableCollections() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/mutableCollections"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/mutableCollections"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("FunctionParameters.java")
|
||||
@@ -3535,7 +3560,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInNewClassExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/newClassExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/newClassExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classWithParam.java")
|
||||
@@ -3623,7 +3648,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInNullability() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/nullability"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/nullability"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("autoNotNull.java")
|
||||
@@ -3826,7 +3851,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInObjectLiteral() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/objectLiteral"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/objectLiteral"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("MyFrame.java")
|
||||
@@ -3854,7 +3879,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInOverloads() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/overloads"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/overloads"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("Annotations.java")
|
||||
@@ -3892,7 +3917,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPackageStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/packageStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/packageStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("keywordInPackageName.java")
|
||||
@@ -3910,7 +3935,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInParenthesizedExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/parenthesizedExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/parenthesizedExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("parenthesized.java")
|
||||
@@ -3933,7 +3958,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPolyadicExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/polyadicExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/polyadicExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("divide.java")
|
||||
@@ -3976,7 +4001,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPostProcessing() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/postProcessing"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/postProcessing"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("AnonymousObject.java")
|
||||
@@ -4044,7 +4069,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPostfixOperator() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/postfixOperator"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/postfixOperator"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("decrement.java")
|
||||
@@ -4067,7 +4092,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPrefixOperator() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/prefixOperator"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/prefixOperator"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("decrement.java")
|
||||
@@ -4110,7 +4135,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInProjections() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/projections"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/projections"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("projections.java")
|
||||
@@ -4128,7 +4153,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInProtected() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/protected"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/protected"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("constructorProperty.java")
|
||||
@@ -4176,7 +4201,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRawGenerics() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/rawGenerics"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/rawGenerics"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("kt-540.java")
|
||||
@@ -4209,7 +4234,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInReturnStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/returnStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/returnStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("currentMethodBug.java")
|
||||
@@ -4247,7 +4272,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSettings() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/settings"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/settings"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("openByDefault.java")
|
||||
@@ -4280,7 +4305,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInStaticMembers() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/staticMembers"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/staticMembers"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateStaticMembers.java")
|
||||
@@ -4318,7 +4343,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInStrings() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/strings"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/strings"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("escapedBackslash.java")
|
||||
@@ -4346,7 +4371,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSuperExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/superExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/superExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classAdotSuperFoo.java")
|
||||
@@ -4374,7 +4399,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSwitch() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/switch"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/switch"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("caseWithBlock.java")
|
||||
@@ -4467,7 +4492,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSynchronizedStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/synchronizedStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/synchronizedStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("singleLineExample.java")
|
||||
@@ -4485,7 +4510,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInThisExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/thisExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/thisExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classAdotThisFoo.java")
|
||||
@@ -4508,7 +4533,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInThrowStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/throwStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/throwStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("simpleThrowStatement.java")
|
||||
@@ -4526,7 +4551,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInToArray() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/toArray"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/toArray"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("toArray.java")
|
||||
@@ -4544,7 +4569,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInToKotlinClasses() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/toKotlinClasses"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/toKotlinClasses"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("iterableAndIterator.java")
|
||||
@@ -4587,7 +4612,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInTrait() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/trait"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/trait"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("emptyInterface.java")
|
||||
@@ -4650,7 +4675,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInTryStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/tryStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/tryStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("commonCaseForTryStatement.java")
|
||||
@@ -4688,7 +4713,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInTryWithResource() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/tryWithResource"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/tryWithResource"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("Multiline.java")
|
||||
@@ -4751,7 +4776,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInTypeCastExpression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/typeCastExpression"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/typeCastExpression"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("beforeDot.java")
|
||||
@@ -4819,7 +4844,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInTypeParameters() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/typeParameters"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/typeParameters"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classDoubleParametrizationWithTwoBoundsWithExtending.java")
|
||||
@@ -4907,7 +4932,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInVarArg() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/varArg"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/varArg"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("ellipsisTypeSeveralParams.java")
|
||||
@@ -4935,7 +4960,7 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInWhileStatement() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/whileStatement"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("nj2k/testData/newJ2k/whileStatement"), Pattern.compile("^([^\\.]+)\\.java$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("whileWithAssignmentAsExpression.java")
|
||||
|
||||
Reference in New Issue
Block a user