Drop javaClass in annotations related things from inspections/quickfixes
This commit is contained in:
@@ -87,8 +87,6 @@ public class KotlinCleanupInspection(): LocalInspectionTool(), CleanupLocalInspe
|
||||
Errors.DEPRECATED_LAMBDA_SYNTAX,
|
||||
Errors.MISSING_CONSTRUCTOR_KEYWORD,
|
||||
Errors.FUNCTION_EXPRESSION_WITH_NAME,
|
||||
Errors.JAVA_LANG_CLASS_PARAMETER_IN_ANNOTATION,
|
||||
ErrorsJvm.JAVA_LANG_CLASS_ARGUMENT_IN_ANNOTATION,
|
||||
Errors.UNNECESSARY_NOT_NULL_ASSERTION,
|
||||
Errors.UNNECESSARY_SAFE_CALL,
|
||||
Errors.USELESS_CAST,
|
||||
|
||||
@@ -25,8 +25,6 @@ import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createClass.CreateClas
|
||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createVariable.CreateLocalVariableActionFactory;
|
||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createVariable.CreateParameterActionFactory;
|
||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createVariable.CreateParameterByNamedArgumentActionFactory;
|
||||
import org.jetbrains.kotlin.idea.quickfix.replaceJavaClass.ReplaceJavaClassAsAnnotationArgumentFix;
|
||||
import org.jetbrains.kotlin.idea.quickfix.replaceJavaClass.ReplaceJavaClassAsAnnotationParameterFix;
|
||||
import org.jetbrains.kotlin.psi.JetClass;
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm;
|
||||
|
||||
@@ -316,15 +314,9 @@ public class QuickFixRegistrar {
|
||||
QuickFixes.factories.put(EXPLICIT_DELEGATION_CALL_REQUIRED, InsertDelegationCallQuickfix.InsertThisDelegationCallFactory.INSTANCE$);
|
||||
QuickFixes.factories.put(EXPLICIT_DELEGATION_CALL_REQUIRED, InsertDelegationCallQuickfix.InsertSuperDelegationCallFactory.INSTANCE$);
|
||||
|
||||
QuickFixes.factories.put(ErrorsJvm.JAVA_LANG_CLASS_ARGUMENT_IN_ANNOTATION, ReplaceJavaClassAsAnnotationArgumentFix.Companion);
|
||||
QuickFixes.factories.put(ErrorsJvm.JAVA_LANG_CLASS_ARGUMENT_IN_ANNOTATION, ReplaceJavaClassAsAnnotationArgumentFix.Companion.createWholeProjectFixFactory());
|
||||
|
||||
QuickFixes.factories.put(ErrorsJvm.DEPRECATED_ANNOTATION_METHOD_CALL, MigrateAnnotationMethodCallFix.Companion);
|
||||
QuickFixes.factories.put(ErrorsJvm.DEPRECATED_ANNOTATION_METHOD_CALL, MigrateAnnotationMethodCallInWholeFile.Companion);
|
||||
|
||||
QuickFixes.factories.put(JAVA_LANG_CLASS_PARAMETER_IN_ANNOTATION, ReplaceJavaClassAsAnnotationParameterFix.Companion);
|
||||
QuickFixes.factories.put(JAVA_LANG_CLASS_PARAMETER_IN_ANNOTATION, ReplaceJavaClassAsAnnotationParameterFix.Companion.createWholeProjectFixFactory());
|
||||
|
||||
QuickFixes.factories.put(ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR, DeprecatedEnumEntrySuperConstructorSyntaxFix.Companion);
|
||||
QuickFixes.factories.put(ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR, DeprecatedEnumEntrySuperConstructorSyntaxFix.Companion.createWholeProjectFixFactory());
|
||||
|
||||
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.quickfix.replaceJavaClass
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionAction
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||
import org.jetbrains.kotlin.idea.JetBundle
|
||||
import org.jetbrains.kotlin.idea.quickfix.*
|
||||
import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionFactory
|
||||
import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionForFirstParentOfType
|
||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||
import org.jetbrains.kotlin.idea.util.ShortenReferences
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
import java.util.ArrayList
|
||||
|
||||
public class ReplaceJavaClassAsAnnotationArgumentFix(
|
||||
annotationEntry: JetAnnotationEntry
|
||||
) : JetIntentionAction<JetAnnotationEntry>(annotationEntry), CleanupFix {
|
||||
|
||||
override fun getText() = JetBundle.message("replace.java.class.argument")
|
||||
override fun getFamilyName() = JetBundle.message("replace.java.class.argument.family")
|
||||
|
||||
override fun invoke(project: Project, editor: Editor?, file: JetFile?) {
|
||||
processTasks(createReplacementTasks(element))
|
||||
}
|
||||
|
||||
companion object : JetSingleIntentionActionFactory() {
|
||||
override fun createAction(diagnostic: Diagnostic) =
|
||||
diagnostic.createIntentionForFirstParentOfType(::ReplaceJavaClassAsAnnotationArgumentFix)
|
||||
|
||||
public fun createWholeProjectFixFactory(): JetSingleIntentionActionFactory = createIntentionFactory {
|
||||
JetWholeProjectForEachElementOfTypeFix.createForMultiTaskOnElement<JetAnnotationEntry, ReplacementTask>(
|
||||
tasksFactory = { createReplacementTasks(it) },
|
||||
tasksProcessor = ::processTasks,
|
||||
name = "Replace javaClass<T>() with T::class in whole project"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.quickfix.replaceJavaClass
|
||||
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||
import org.jetbrains.kotlin.idea.JetBundle
|
||||
import org.jetbrains.kotlin.idea.quickfix.CleanupFix
|
||||
import org.jetbrains.kotlin.idea.quickfix.JetIntentionAction
|
||||
import org.jetbrains.kotlin.idea.quickfix.JetSingleIntentionActionFactory
|
||||
import org.jetbrains.kotlin.idea.quickfix.JetWholeProjectForEachElementOfTypeFix
|
||||
import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionFactory
|
||||
import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionForFirstParentOfType
|
||||
import org.jetbrains.kotlin.psi.JetClass
|
||||
import org.jetbrains.kotlin.psi.JetFile
|
||||
|
||||
public class ReplaceJavaClassAsAnnotationParameterFix(
|
||||
annotationClass: JetClass
|
||||
) : JetIntentionAction<JetClass>(annotationClass), CleanupFix {
|
||||
|
||||
override fun getText() = JetBundle.message("replace.java.class.parameter")
|
||||
override fun getFamilyName() = JetBundle.message("replace.java.class.parameter.family")
|
||||
|
||||
override fun invoke(project: Project, editor: Editor?, file: JetFile?) {
|
||||
processTasks(createReplacementTasksForAnnotationClass(element))
|
||||
}
|
||||
|
||||
companion object : JetSingleIntentionActionFactory() {
|
||||
override fun createAction(diagnostic: Diagnostic) =
|
||||
diagnostic.createIntentionForFirstParentOfType(::ReplaceJavaClassAsAnnotationParameterFix)
|
||||
|
||||
public fun createWholeProjectFixFactory(): JetSingleIntentionActionFactory = createIntentionFactory {
|
||||
JetWholeProjectForEachElementOfTypeFix.createForMultiTaskOnElement(
|
||||
tasksFactory = ::createReplacementTasksForAnnotationClass,
|
||||
tasksProcessor = ::processTasks,
|
||||
name = "Replace Class<T> with KClass<T> for each annotation in project"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.quickfix.replaceJavaClass
|
||||
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||
import org.jetbrains.kotlin.idea.search.usagesSearch.ClassUsagesSearchHelper
|
||||
import org.jetbrains.kotlin.idea.search.usagesSearch.UsagesSearch
|
||||
import org.jetbrains.kotlin.idea.search.usagesSearch.UsagesSearchTarget
|
||||
import org.jetbrains.kotlin.idea.search.usagesSearch.descriptor
|
||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||
import org.jetbrains.kotlin.idea.util.ShortenReferences
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.forEachDescendantOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.isAncestor
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
|
||||
import org.jetbrains.kotlin.types.JetType
|
||||
import org.jetbrains.kotlin.types.typeUtil.isArrayOfJavaLangClass
|
||||
import org.jetbrains.kotlin.types.typeUtil.isJavaLangClass
|
||||
|
||||
private trait ReplacementTask {
|
||||
val element: JetElement
|
||||
}
|
||||
private class JavaClassCallReplacementTask(
|
||||
val javaClassCall: JetExpression,
|
||||
val className: String
|
||||
) : ReplacementTask {
|
||||
override val element: JetElement = javaClassCall
|
||||
}
|
||||
private class JavaClassParameterReplacementTask(
|
||||
val typeReference: JetTypeReference,
|
||||
val projectionText: String
|
||||
) : ReplacementTask {
|
||||
override val element: JetElement = typeReference
|
||||
}
|
||||
|
||||
private fun renderClassNameForKClassLiteral(type: JetType): String? {
|
||||
val descriptorRenderer = IdeDescriptorRenderers.SOURCE_CODE
|
||||
if (KotlinBuiltIns.isArray(type)) {
|
||||
return descriptorRenderer.renderType(type)
|
||||
}
|
||||
|
||||
val classDescriptor = (type.getConstructor().getDeclarationDescriptor() as? ClassDescriptor) ?: return null
|
||||
return descriptorRenderer.renderClassifierName(classDescriptor)
|
||||
}
|
||||
|
||||
fun createReplacementTasks(element: JetElement, anyJavaClass: Boolean = false): List<ReplacementTask> {
|
||||
val replacementTasks = arrayListOf<ReplacementTask>()
|
||||
|
||||
element.forEachDescendantOfType(fun(expression: JetCallExpression) {
|
||||
val context = expression.analyze()
|
||||
val resolvedCall = expression.getResolvedCall(context) ?: return
|
||||
|
||||
if (!anyJavaClass && !context.getDiagnostics().any { it.isJavaLangClassArgumentInAnnotation(expression) }) return
|
||||
|
||||
val returnType = resolvedCall.getResultingDescriptor().getReturnType() ?: return
|
||||
if (returnType.isJavaLangClass()) {
|
||||
val inferredType = returnType.getArguments().firstOrNull()?.getType() ?: return
|
||||
if (inferredType.isError()) return
|
||||
val renderedType = renderClassNameForKClassLiteral(inferredType) ?: return
|
||||
replacementTasks.add(JavaClassCallReplacementTask(expression, renderedType))
|
||||
}
|
||||
})
|
||||
|
||||
return replacementTasks
|
||||
}
|
||||
|
||||
fun createReplacementTasksForAnnotationClass(element: JetClass): List<ReplacementTask> {
|
||||
if (!element.isAnnotation()) return emptyList()
|
||||
|
||||
val replacementTasks = arrayListOf<ReplacementTask>()
|
||||
|
||||
fun addJavaClassReplacementTaskByTypeReference(typeReference: JetTypeReference) {
|
||||
val classTypeArgText = typeReference.getFirstTypeArgument()?.getText() ?: return
|
||||
replacementTasks.add(JavaClassParameterReplacementTask(typeReference, classTypeArgText))
|
||||
}
|
||||
|
||||
element.forEachDescendantOfType(fun(parameter: JetParameter) {
|
||||
val valueParameterDescriptor = parameter.descriptor as? ValueParameterDescriptor ?: return
|
||||
val type = valueParameterDescriptor.getType()
|
||||
|
||||
val parameterTypeReference = parameter.getTypeReference() ?: return
|
||||
if (type.isJavaLangClass() || valueParameterDescriptor.getVarargElementType()?.isJavaLangClass() ?: false) {
|
||||
addJavaClassReplacementTaskByTypeReference(parameterTypeReference)
|
||||
}
|
||||
else if (type.isArrayOfJavaLangClass()) {
|
||||
val arrayTypeArgumentReference = parameterTypeReference.getFirstTypeArgument()?.getTypeReference() ?: return
|
||||
addJavaClassReplacementTaskByTypeReference(arrayTypeArgumentReference)
|
||||
}
|
||||
|
||||
val defaultValue = parameter.getDefaultValue()
|
||||
if (defaultValue != null) {
|
||||
replacementTasks.addAll(createReplacementTasks(defaultValue, anyJavaClass = true))
|
||||
}
|
||||
})
|
||||
|
||||
if (replacementTasks.isEmpty()) return emptyList()
|
||||
|
||||
val request = ClassUsagesSearchHelper(
|
||||
constructorUsages = true, nonConstructorUsages = false, skipImports = true
|
||||
).newRequest(UsagesSearchTarget<JetClassOrObject>(element))
|
||||
|
||||
UsagesSearch.search(request).forEach {
|
||||
ref ->
|
||||
val refElement = ref?.getElement()?.getNonStrictParentOfType<JetAnnotationEntry>()
|
||||
if (refElement != null) {
|
||||
replacementTasks.addAll(createReplacementTasks(refElement, anyJavaClass = true))
|
||||
}
|
||||
}
|
||||
|
||||
return replacementTasks
|
||||
}
|
||||
|
||||
private fun JetTypeReference.getFirstTypeArgument(): JetTypeProjection? =
|
||||
(getTypeElement() as? JetUserType)?.getTypeArguments()?.firstOrNull()
|
||||
|
||||
private fun Diagnostic.isJavaLangClassArgumentInAnnotation(expression: JetCallExpression) =
|
||||
getFactory() == ErrorsJvm.JAVA_LANG_CLASS_ARGUMENT_IN_ANNOTATION &&
|
||||
getPsiElement().isAncestor(expression)
|
||||
|
||||
fun processTasks(replacementTasks: Collection<ReplacementTask>) {
|
||||
val element = replacementTasks.firstOrNull()?.element ?: return
|
||||
val psiFactory = JetPsiFactory(element)
|
||||
|
||||
val elementsToShorten = arrayListOf<JetElement>()
|
||||
replacementTasks.forEach {
|
||||
task ->
|
||||
val newElement = when (task) {
|
||||
is JavaClassCallReplacementTask ->
|
||||
task.javaClassCall.replace(psiFactory.createClassLiteral(task.className)) as JetElement
|
||||
is JavaClassParameterReplacementTask ->
|
||||
task.typeReference.replace(psiFactory.createType("kotlin.reflect.KClass<${task.projectionText}>")) as JetElement
|
||||
else -> error("Unexpected task type: ${task.javaClass.getName()}")
|
||||
}
|
||||
|
||||
elementsToShorten.add(newElement)
|
||||
}
|
||||
|
||||
ShortenReferences.DEFAULT.process(elementsToShorten)
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
public @interface JavaAnn {
|
||||
int value();
|
||||
String arg1();
|
||||
Class<?>[] arg2();
|
||||
Class<?> arg3();
|
||||
int arg4() default 0;
|
||||
}
|
||||
|
||||
+1
-5
@@ -12,10 +12,6 @@ enum class F(val name: String) {
|
||||
|
||||
val f = { (a: Int, b: Int) -> a + b }
|
||||
|
||||
annotation class Ann(val arg1: Class<*>, val arg2: Class<out Any?>)
|
||||
|
||||
Ann(javaClass<String>(), javaClass<Int>()) class MyClass
|
||||
|
||||
class A private()
|
||||
|
||||
val x = fun foo(x: String) { }
|
||||
@@ -43,4 +39,4 @@ fun unnecessaryCast(x: String) = x as String
|
||||
|
||||
fun unnecessaryElvis(x: String) = x ?: ""
|
||||
|
||||
JavaAnn(1, "abc", arrayOf(javaClass<Array<Int>>()), javaClass<String>()) class MyClass
|
||||
JavaAnn(1, "abc") class MyClass
|
||||
|
||||
+1
-7
@@ -1,5 +1,3 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
interface Foo {
|
||||
}
|
||||
|
||||
@@ -14,10 +12,6 @@ enum class F(val name: String) {
|
||||
|
||||
val f = { a: Int, b: Int -> a + b }
|
||||
|
||||
annotation class Ann(val arg1: KClass<*>, val arg2: KClass<out Any?>)
|
||||
|
||||
Ann(String::class, Int::class) class MyClass
|
||||
|
||||
class A private constructor()
|
||||
|
||||
val x = fun(x: String) { }
|
||||
@@ -45,4 +39,4 @@ fun unnecessaryCast(x: String) = x
|
||||
|
||||
fun unnecessaryElvis(x: String) = x
|
||||
|
||||
JavaAnn(1, arg1 = "abc", arg2 = arrayOf(Array<Int>::class), arg3 = String::class) class MyClass
|
||||
JavaAnn(1, arg1 = "abc") class MyClass
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(val arg: Array<Class<*>><caret>)
|
||||
|
||||
Ann(arg = array(javaClass<String>(), javaClass<Double>())) class MyClass
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(val arg: Array<KClass<*>>)
|
||||
|
||||
Ann(arg = array(String::class, Double::class)) class MyClass
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(val arg1: Class<*><caret>, val arg2: Class<out Any?>)
|
||||
|
||||
Ann(javaClass<String>(), javaClass<Int>()) class MyClass
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(val arg1: KClass<*>, val arg2: KClass<out Any?>)
|
||||
|
||||
Ann(String::class, Int::class) class MyClass
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(
|
||||
val arg1: Int,
|
||||
val arg2: Class<*><caret> = javaClass<Int>(),
|
||||
val arg3: Array<Class<out Any?>> = array(javaClass<String>()),
|
||||
vararg val arg4: Class<out Any?> = array(javaClass<Double>())
|
||||
)
|
||||
|
||||
Ann(arg1 = 1) class MyClass1
|
||||
Ann(arg1 = 2, arg2 = javaClass<Boolean>()) class MyClass2
|
||||
Ann(arg1 = 3, arg3 = array(javaClass<Boolean>())) class MyClass3
|
||||
Ann(arg1 = 4, arg4 = javaClass<String>()) class MyClass4
|
||||
Vendored
-16
@@ -1,16 +0,0 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(
|
||||
val arg1: Int,
|
||||
val arg2: KClass<*> = Int::class,
|
||||
val arg3: Array<KClass<out Any?>> = array(String::class),
|
||||
vararg val arg4: KClass<out Any?> = array(Double::class)
|
||||
)
|
||||
|
||||
Ann(arg1 = 1) class MyClass1
|
||||
Ann(arg1 = 2, arg2 = Boolean::class) class MyClass2
|
||||
Ann(arg1 = 3, arg3 = array(Boolean::class)) class MyClass3
|
||||
Ann(arg1 = 4, arg4 = String::class) class MyClass4
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
@Ann1(String.class)
|
||||
class A {}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation class AnnO(val arg: KClass<*>)
|
||||
|
||||
AnnO(Int::class)
|
||||
Ann1(String::class)
|
||||
class MyClassO
|
||||
Vendored
-26
@@ -1,26 +0,0 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
// "Replace Class<T> with KClass<T> for each annotation in project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann1(val arg: KClass<*>)
|
||||
|
||||
Ann1(String::class) class MyClass1
|
||||
Ann1(MyClass1::class) class MyClass2
|
||||
|
||||
annotation class Ann2(val arg: Array<KClass<*>>)
|
||||
|
||||
Ann2(arg = array(Double::class)) class MyClass3 @Ann1(Char::class) constructor() {
|
||||
annotation class Ann3(val arg: KClass<*> = Any::class)
|
||||
|
||||
Ann3(String::class) class Nested {
|
||||
Ann1(arg = String::class) fun foo1() {
|
||||
annotation class LocalAnn(val arg: KClass<*>)
|
||||
@LocalAnn(Class::class) val x = 1
|
||||
}
|
||||
}
|
||||
|
||||
inner AnnO(Double::class) class Inner
|
||||
}
|
||||
|
||||
AnnO(Boolean::class) class Another
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
@Ann1(String.class)
|
||||
class A {}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
annotation class AnnO(val arg: Class<*>)
|
||||
|
||||
AnnO(javaClass<Int>())
|
||||
Ann1(javaClass<String>())
|
||||
class MyClassO
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
// "Replace Class<T> with KClass<T> for each annotation in project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann1(val arg: Class<*><caret>)
|
||||
|
||||
Ann1(javaClass<String>()) class MyClass1
|
||||
Ann1(javaClass<MyClass1>()) class MyClass2
|
||||
|
||||
annotation class Ann2(val arg: Array<Class<*>>)
|
||||
|
||||
Ann2(arg = array(javaClass<Double>())) class MyClass3 @Ann1(javaClass<Char>()) constructor() {
|
||||
annotation class Ann3(val arg: Class<*> = javaClass<Any>())
|
||||
|
||||
Ann3(javaClass<String>()) class Nested {
|
||||
Ann1(arg = javaClass<String>()) fun foo1() {
|
||||
annotation class LocalAnn(val arg: Class<*>)
|
||||
@LocalAnn(javaClass<Class<*>>()) val x = 1
|
||||
}
|
||||
}
|
||||
|
||||
inner AnnO(javaClass<Double>()) class Inner
|
||||
}
|
||||
|
||||
AnnO(javaClass<Boolean>()) class Another
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// ERROR: <html>Type inference failed. Expected type mismatch: <table><tr><td>required: </td><td><b>kotlin.reflect.KClass<*></b></td></tr><tr><td>found: </td><td><font color=red><b>java.lang.Class<???></b></font></td></tr></table></html>
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.reflect.KClass<*></td></tr><tr><td>Found:</td><td>java.lang.Class<[ERROR : Err]></td></tr></table></html>
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.reflect.KClass<*></td></tr><tr><td>Found:</td><td>java.lang.Class<kotlin.Double></td></tr></table></html>
|
||||
// ERROR: Unresolved reference: Err
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(vararg val arg: Class<*><caret>)
|
||||
|
||||
Ann(javaClass<String>(), javaClass<Err>()) class MyClass1
|
||||
Ann(javaClass<String>(), javaClass()) class MyClass2
|
||||
|
||||
val x = javaClass<Double>()
|
||||
Ann(javaClass<String>(), x) class MyClass3
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// ERROR: <html>Type inference failed. Expected type mismatch: <table><tr><td>required: </td><td><b>kotlin.reflect.KClass<*></b></td></tr><tr><td>found: </td><td><font color=red><b>java.lang.Class<???></b></font></td></tr></table></html>
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.reflect.KClass<*></td></tr><tr><td>Found:</td><td>java.lang.Class<[ERROR : Err]></td></tr></table></html>
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.reflect.KClass<*></td></tr><tr><td>Found:</td><td>java.lang.Class<kotlin.Double></td></tr></table></html>
|
||||
// ERROR: Unresolved reference: Err
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(vararg val arg: KClass<*>)
|
||||
|
||||
Ann(String::class, javaClass<Err>()) class MyClass1
|
||||
Ann(String::class, javaClass()) class MyClass2
|
||||
|
||||
val x = javaClass<Double>()
|
||||
Ann(String::class, x) class MyClass3
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(vararg val arg: Class<*><caret>)
|
||||
|
||||
Ann(javaClass<String>(), javaClass<Double>(), *array(javaClass<Char>())) class MyClass
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
// "Replace Class<T> with KClass<T> in whole annotation" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
annotation class Ann(vararg val arg: KClass<*>)
|
||||
|
||||
Ann(String::class, Double::class, *array(Char::class)) class MyClass
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
import java.lang.Number
|
||||
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(arg = array(Int::class, String::class)) class MyClass1
|
||||
|
||||
Ann(arg = array<java.lang.Class<*>>(Number::class, String::class)) class MyClass2
|
||||
|
||||
Ann(arg = array<java.lang.Class<out kotlin.Comparable<*>>>(Int::class, String::class)) class MyClass3
|
||||
|
||||
Ann(arg = array<java.lang.Class<Int>>(Int::class)) class MyClass4
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?>[] arg();
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(arg = array(javaClass<Int>(), javaClass<String>()<caret>)) class MyClass1
|
||||
|
||||
Ann(arg = array<java.lang.Class<*>>(javaClass<java.lang.Number>(), javaClass<String>())) class MyClass2
|
||||
|
||||
Ann(arg = array<java.lang.Class<out kotlin.Comparable<*>>>(javaClass<kotlin.Int>(), javaClass<String>())) class MyClass3
|
||||
|
||||
Ann(arg = array<java.lang.Class<Int>>(javaClass<kotlin.Int>())) class MyClass4
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(String::class<caret>) class MyClass
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?> value();
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass<String>()<caret>) class MyClass
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(List::class) class MyClass1
|
||||
Ann(List::class) class MyClass2
|
||||
Ann(MutableList::class) class MyClass3
|
||||
|
||||
Ann(Array<String>::class) class MyClass4
|
||||
Ann(Array<*>::class) class MyClass5
|
||||
Ann(Array<in String>::class) class MyClass6
|
||||
|
||||
class Outer<T> {
|
||||
Ann(Array<T>::class)
|
||||
class Nested
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass<List<String>><caret>()) class MyClass1
|
||||
Ann(javaClass<List<*>>()) class MyClass2
|
||||
Ann(javaClass<MutableList<in String>>()) class MyClass3
|
||||
|
||||
Ann(javaClass<Array<String>>()) class MyClass4
|
||||
Ann(javaClass<Array<*>>()) class MyClass5
|
||||
Ann(javaClass<Array<in String>>()) class MyClass6
|
||||
|
||||
class Outer<T> {
|
||||
Ann(javaClass<Array<T>>())
|
||||
class Nested
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?> value();
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
import java.util.Random
|
||||
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(A::class, A::class, *array(A::class), arg1 = A.B::class, arg2 = Random::class) class MyClass
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<? extends A>[] value();
|
||||
Class<? extends A.B> arg1();
|
||||
Class<? extends java.util.Random> arg2();
|
||||
}
|
||||
|
||||
class A {
|
||||
static class B {}
|
||||
}
|
||||
|
||||
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass(), javaClass(), *array(javaClass())<caret>, arg1 = javaClass(), arg2 = javaClass()) class MyClass
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(String::class) class MyClass
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(String::class, arg = Int::class, args = array()) class MyClass1
|
||||
|
||||
Ann(String::class, arg = Int::class, x = 1, args = array(Double::class)) class MyClass2 {
|
||||
Ann(String::class, arg = Int::class, args = array(Double::class)) class Nested {
|
||||
Ann(String::class, arg = Int::class, args = array(Double::class)) fun foo1() {
|
||||
|
||||
@Ann(String::class, arg = Int::class, args = array(Double::class)) class Local
|
||||
}
|
||||
|
||||
@Ann(String::class, arg = Int::class, args = array(Double::class), x = 1) fun foo2() {
|
||||
|
||||
@Ann(String::class, arg = Int::class, args = array(Double::class)) val local = 0
|
||||
}
|
||||
}
|
||||
|
||||
inner Ann(Double::class) class Inner
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?> value();
|
||||
int x() default 1;
|
||||
double y() default 1.0;
|
||||
Class<?> arg() default String;
|
||||
Class<?>[] args() default {};
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass<String>()) class MyClass
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class in whole project" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass<String>()<caret>, arg = javaClass<Int>(), args = array()) class MyClass1
|
||||
|
||||
Ann(javaClass<String>(), arg = javaClass<Int>(), x = 1, args = array(javaClass<Double>())) class MyClass2 {
|
||||
Ann(javaClass<String>(), arg = javaClass<Int>(), args = array(javaClass<Double>())) class Nested {
|
||||
Ann(javaClass<String>(), arg = javaClass<Int>(), args = array(javaClass<Double>())) fun foo1() {
|
||||
|
||||
@Ann(javaClass<String>(), arg = javaClass<Int>(), args = array(javaClass<Double>())) class Local
|
||||
}
|
||||
|
||||
@Ann(javaClass<String>(), arg = javaClass<Int>(), args = array(javaClass<Double>()), x = 1) fun foo2() {
|
||||
|
||||
@Ann(javaClass<String>(), arg = javaClass<Int>(), args = array(javaClass<Double>())) val local = 0
|
||||
}
|
||||
}
|
||||
|
||||
inner Ann(javaClass<Double>()) class Inner
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// ERROR: An annotation parameter must be a `javaClass<T>()` call
|
||||
// WITH_RUNTIME
|
||||
|
||||
val jClass = javaClass<String>()
|
||||
Ann(jClass, Int::class) class MyClass1
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?>[] value();
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// ERROR: An annotation parameter must be a `javaClass<T>()` call
|
||||
// WITH_RUNTIME
|
||||
|
||||
val jClass = javaClass<String>()
|
||||
Ann(jClass, javaClass<Int>()<caret>) class MyClass1
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
import java.lang
|
||||
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(String::class, x = 2, arg = (Int::class), args = array((Any::class), lang.String::class)) class MyClass
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?> value();
|
||||
int x();
|
||||
double y() default 1.0;
|
||||
Class<?> arg();
|
||||
Class<?>[] args();
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass<String>(), x = 2, arg = (javaClass<Int>()), args = array((javaClass<Any>()), javaClass<java.lang.String>())<caret>) class MyClass
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// ERROR: Unresolved reference: Err
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass<Err>(), Int::class) class MyClass1
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?>[] value();
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// ERROR: Unresolved reference: Err
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(javaClass<Err>(), javaClass<Int>()<caret>) class MyClass1
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import java.lang
|
||||
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(
|
||||
String::class,
|
||||
Int::class,
|
||||
*array(Double::class),
|
||||
x = 2,
|
||||
arg = Int::class,
|
||||
args = array(Any::class, lang.String::class))
|
||||
class MyClass
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
public @interface Ann {
|
||||
Class<?>[] value();
|
||||
int x();
|
||||
double y() default 1.0;
|
||||
Class<?> arg();
|
||||
Class<?>[] args();
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
// "Replace javaClass<T>() with T::class" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
Ann(
|
||||
javaClass<String>(),
|
||||
javaClass<Int>(),
|
||||
*array(javaClass<Double>()),
|
||||
x = 2,
|
||||
arg = javaClass<Int>(),
|
||||
args = array(javaClass<Any>(), javaClass<java.lang.String>())<caret>)
|
||||
class MyClass
|
||||
@@ -1056,84 +1056,6 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ReplaceJavaClassAsAnnotationParameter extends AbstractQuickFixMultiFileTest {
|
||||
public void testAllFilesPresentInReplaceJavaClassAsAnnotationParameter() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter"), Pattern.compile("^(\\w+)\\.before\\.Main\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("manyFilesMultiple.before.Main.kt")
|
||||
public void testManyFilesMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter/manyFilesMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ReplaceJavaClassWithKClassForJavaAnnotation extends AbstractQuickFixMultiFileTest {
|
||||
public void testAllFilesPresentInReplaceJavaClassWithKClassForJavaAnnotation() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation"), Pattern.compile("^(\\w+)\\.before\\.Main\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayWithExplicitTypeArgumentMultiple.before.Main.kt")
|
||||
public void testArrayWithExplicitTypeArgumentMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/arrayWithExplicitTypeArgumentMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("basicMultiple.before.Main.kt")
|
||||
public void testBasicMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/basicMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("genericArgumentMultiple.before.Main.kt")
|
||||
public void testGenericArgumentMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/genericArgumentMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("implicitParameterMultiple.before.Main.kt")
|
||||
public void testImplicitParameterMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/implicitParameterMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("manyFilesMultiple.before.Main.kt")
|
||||
public void testManyFilesMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/manyFilesMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nonConstMultiple.before.Main.kt")
|
||||
public void testNonConstMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/nonConstMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("severalArgsMultiple.before.Main.kt")
|
||||
public void testSeveralArgsMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/severalArgsMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("unresolvedMultiple.before.Main.kt")
|
||||
public void testUnresolvedMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/unresolvedMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("valueAsVarargMultiple.before.Main.kt")
|
||||
public void testValueAsVarargMultiple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassWithKClassForJavaAnnotation/valueAsVarargMultiple.before.Main.kt");
|
||||
doTestWithExtraFile(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/modifiers")
|
||||
|
||||
@@ -4124,45 +4124,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ReplaceJavaClassAsAnnotationParameter extends AbstractQuickFixTest {
|
||||
public void testAllFilesPresentInReplaceJavaClassAsAnnotationParameter() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("arrayRuntime.kt")
|
||||
public void testArrayRuntime() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter/arrayRuntime.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("basicRuntime.kt")
|
||||
public void testBasicRuntime() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter/basicRuntime.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultRuntime.kt")
|
||||
public void testDefaultRuntime() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter/defaultRuntime.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("usageWithErrorRuntime.kt")
|
||||
public void testUsageWithErrorRuntime() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter/usageWithErrorRuntime.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("varargRuntime.kt")
|
||||
public void testVarargRuntime() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/replaceJavaClassAsAnnotationParameter/varargRuntime.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/quickfix/migration/traitToInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user