Move all annotation FQ names to JvmAnnotationNames
Delete reflected usages of annotation classes (JetValueParameter.class, KotlinSignature.class, etc.). It's wrong: this is a dependency on the old runtime, whereas the compiler should work with the new one
This commit is contained in:
@@ -19,7 +19,6 @@ package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import jet.runtime.typeinfo.JetValueParameter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.asm4.AnnotationVisitor;
|
||||
@@ -56,7 +55,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContextUtils.callableDescrip
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContextUtils.descriptorToDeclaration;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isFunctionLiteral;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.resolver.DescriptorResolverUtils.fqNameByClass;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.OLD_JET_VALUE_PARAMETER_ANNOTATION;
|
||||
|
||||
public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
private final CodegenContext owner;
|
||||
@@ -213,7 +212,7 @@ public class FunctionCodegen extends ParentCodegenAwareImpl {
|
||||
}
|
||||
|
||||
AnnotationVisitor av =
|
||||
mv.visitParameterAnnotation(i, asmDescByFqNameWithoutInnerClasses(fqNameByClass(JetValueParameter.class)), true);
|
||||
mv.visitParameterAnnotation(i, asmDescByFqNameWithoutInnerClasses(OLD_JET_VALUE_PARAMETER_ANNOTATION), true);
|
||||
if (av != null) {
|
||||
av.visit("name", name);
|
||||
if (nullableType) {
|
||||
|
||||
+3
-7
@@ -17,20 +17,16 @@
|
||||
package org.jetbrains.jet.lang.resolve.java.kotlinSignature;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.resolve.java.resolver.ExternalAnnotationResolver;
|
||||
import org.jetbrains.jet.lang.resolve.java.structure.*;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.java.resolver.DescriptorResolverUtils.fqNameByClass;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.DEFAULT_ANNOTATION_MEMBER_NAME;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KOTLIN_SIGNATURE;
|
||||
|
||||
public class SignaturesUtil {
|
||||
public static final FqName KOTLIN_SIGNATURE = fqNameByClass(KotlinSignature.class);
|
||||
public static final Name KOTLIN_SIGNATURE_VALUE_FIELD_NAME = Name.identifier("value");
|
||||
|
||||
private SignaturesUtil() {
|
||||
}
|
||||
|
||||
@@ -39,7 +35,7 @@ public class SignaturesUtil {
|
||||
JavaAnnotation annotation = findAnnotationWithExternal(externalAnnotationResolver, member, KOTLIN_SIGNATURE);
|
||||
|
||||
if (annotation != null) {
|
||||
JavaAnnotationArgument argument = annotation.findArgument(KOTLIN_SIGNATURE_VALUE_FIELD_NAME);
|
||||
JavaAnnotationArgument argument = annotation.findArgument(DEFAULT_ANNOTATION_MEMBER_NAME);
|
||||
if (argument instanceof JavaLiteralAnnotationArgument) {
|
||||
Object value = ((JavaLiteralAnnotationArgument) argument).getValue();
|
||||
if (value instanceof String) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.TestJdkKind;
|
||||
import org.jetbrains.jet.cli.jvm.compiler.CoreExternalAnnotationsManager;
|
||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||
import org.jetbrains.jet.lang.resolve.java.kotlinSignature.SignaturesUtil;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.KotlinTestWithEnvironment;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
|
||||
@@ -166,9 +166,9 @@ public class IdeaJdkAnnotationsReflectedTest extends KotlinTestWithEnvironment {
|
||||
}
|
||||
|
||||
private enum AnnotationsKind {
|
||||
KOTLIN_SIGNATURE(SignaturesUtil.KOTLIN_SIGNATURE.asString()),
|
||||
KOTLIN_SIGNATURE(JvmAnnotationNames.KOTLIN_SIGNATURE.asString()),
|
||||
NOT_NULL(AnnotationUtil.NOT_NULL),
|
||||
ANY(AnnotationUtil.NOT_NULL, SignaturesUtil.KOTLIN_SIGNATURE.asString());
|
||||
ANY(AnnotationUtil.NOT_NULL, JvmAnnotationNames.KOTLIN_SIGNATURE.asString());
|
||||
|
||||
public final String[] annotationNames;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user