From a9b57a5535b9aebbf4ee23fd9e34b2aeea926046 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Tue, 16 Jul 2013 19:06:53 +0400 Subject: [PATCH] Rearrange JvmStdlibNames, delete old annotations Delete unused constants Move constants related to abi to JvmAbi class Constants related to annotation names are now in JvmAnnotationNames Remove old annotation classes Deprecate JetClass and JetPackageClass name constants --- .../codegen/ImplementationBodyCodegen.java | 10 +- .../jet/codegen/NamespaceCodegen.java | 8 +- .../resolve/java/DescriptorResolverUtils.java | 4 +- .../resolve/java/JavaTypeTransformer.java | 4 +- .../jet/lang/resolve/java/JvmAbi.java | 10 +- .../lang/resolve/java/JvmAnnotationNames.java | 52 ++++++++++ .../jet/lang/resolve/java/JvmClassName.java | 5 + .../jet/lang/resolve/java/JvmStdlibNames.java | 98 ------------------- .../lang/resolve/java/PsiClassFinderImpl.java | 2 +- .../java/kt/KotlinSignatureAnnotation.java | 6 +- .../AnnotationDescriptorDeserializer.java | 4 +- .../DeserializedDescriptorResolver.java | 10 +- .../java/resolver/JavaAnnotationResolver.java | 6 +- .../java/resolver/JavaFunctionResolver.java | 2 +- .../java/resolver/JavaNamespaceResolver.java | 3 +- .../java/resolver/JavaPropertyResolver.java | 2 +- .../java/resolver/JavaSupertypeResolver.java | 2 +- .../resolver/JavaValueParameterResolver.java | 4 +- .../AbstractCompileJavaAgainstKotlinTest.java | 3 - .../IdeaJdkAnnotationsReflectedTest.java | 6 +- .../ktSignature/KotlinSignatureUtil.java | 4 +- .../versions/KotlinAbiVersionIndex.java | 13 +-- .../src/jet/runtime/typeinfo/JetClass.java | 36 ------- .../jet/runtime/typeinfo/JetClassObject.java | 21 ---- .../jet/runtime/typeinfo/JetConstructor.java | 30 ------ .../src/jet/runtime/typeinfo/JetMethod.java | 75 -------------- .../jet/runtime/typeinfo/JetPackageClass.java | 28 ------ .../runtime/typeinfo/JetTypeDescriptor.java | 36 ------- .../runtime/typeinfo/JetTypeParameter.java | 36 ------- .../runtime/typeinfo/JetTypeProjection.java | 32 ------ .../runtime/typeinfo/JetValueParameter.java | 59 ----------- 31 files changed, 105 insertions(+), 506 deletions(-) create mode 100644 compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAnnotationNames.java delete mode 100644 compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmStdlibNames.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetClass.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetClassObject.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetConstructor.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetMethod.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetPackageClass.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetTypeDescriptor.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetTypeParameter.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetTypeProjection.java delete mode 100644 runtime/src/jet/runtime/typeinfo/JetValueParameter.java diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java index 944ec50f048..0293cf26e12 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java @@ -55,8 +55,8 @@ import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants; import org.jetbrains.jet.lang.resolve.java.JvmAbi; +import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import org.jetbrains.jet.lang.resolve.java.JvmClassName; -import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames; import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.TypeUtils; @@ -222,9 +222,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { ClassData data = new ClassData(createNameResolver(serializer.getNameTable()), classProto); - AnnotationVisitor av = v.getVisitor().visitAnnotation(JvmStdlibNames.KOTLIN_CLASS.getDescriptor(), true); - av.visit(JvmStdlibNames.ABI_VERSION_NAME, JvmAbi.VERSION); - AnnotationVisitor array = av.visitArray(JvmStdlibNames.KOTLIN_INFO_DATA_FIELD); + AnnotationVisitor av = v.getVisitor().visitAnnotation(JvmAnnotationNames.KOTLIN_CLASS.getDescriptor(), true); + av.visit(JvmAnnotationNames.ABI_VERSION_FIELD_NAME, JvmAbi.VERSION); + AnnotationVisitor array = av.visitArray(JvmAnnotationNames.DATA_FIELD_NAME); for (String string : JavaProtoBufUtil.encodeBytes(data.toBytes())) { array.visit(null, string); } @@ -371,7 +371,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { { // superinterfaces - superInterfacesLinkedHashSet.add(JvmStdlibNames.JET_OBJECT.getInternalName()); + superInterfacesLinkedHashSet.add(JvmAbi.JET_OBJECT.getInternalName()); for (JetDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) { JetType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference()); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java index e94fdbb6b1d..22ca3c2afde 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java @@ -42,8 +42,8 @@ import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.java.JvmAbi; +import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import org.jetbrains.jet.lang.resolve.java.JvmClassName; -import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames; import org.jetbrains.jet.lang.resolve.java.PackageClassUtils; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.Name; @@ -145,9 +145,9 @@ public class NamespaceCodegen extends MemberCodegen { PackageData data = new PackageData(createNameResolver(serializer.getNameTable()), packageProto); - AnnotationVisitor av = v.getClassBuilder().newAnnotation(JvmStdlibNames.KOTLIN_PACKAGE.getDescriptor(), true); - av.visit(JvmStdlibNames.ABI_VERSION_NAME, JvmAbi.VERSION); - AnnotationVisitor array = av.visitArray(JvmStdlibNames.KOTLIN_INFO_DATA_FIELD); + AnnotationVisitor av = v.getClassBuilder().newAnnotation(JvmAnnotationNames.KOTLIN_PACKAGE.getDescriptor(), true); + av.visit(JvmAnnotationNames.ABI_VERSION_FIELD_NAME, JvmAbi.VERSION); + AnnotationVisitor array = av.visitArray(JvmAnnotationNames.DATA_FIELD_NAME); for (String string : JavaProtoBufUtil.encodeBytes(data.toBytes())) { array.visit(null, string); } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/DescriptorResolverUtils.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/DescriptorResolverUtils.java index 15ae9c062af..150b28d2d77 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/DescriptorResolverUtils.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/DescriptorResolverUtils.java @@ -51,14 +51,14 @@ public final class DescriptorResolverUtils { if (!PackageClassUtils.isPackageClassFqName(new FqName(psiClass.getQualifiedName()))) { return false; } - return hasAnnotation(psiClass, JvmStdlibNames.KOTLIN_PACKAGE.getFqName()); + return hasAnnotation(psiClass, JvmAnnotationNames.KOTLIN_PACKAGE.getFqName()); } public static boolean isCompiledKotlinClass(@NotNull PsiClass psiClass) { if (!(psiClass instanceof ClsClassImpl)) { return false; } - return hasAnnotation(psiClass, JvmStdlibNames.KOTLIN_CLASS.getFqName()); + return hasAnnotation(psiClass, JvmAnnotationNames.KOTLIN_CLASS.getFqName()); } public static boolean hasAnnotation(@NotNull PsiClass psiClass, @NotNull FqName annotationFqName) { diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java index 5bd5219e9d9..b4dd6de58ad 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java @@ -280,10 +280,10 @@ public class JavaTypeTransformer { if (!signatureTypeUsages.contains(originalTypeUsage)) { return originalTypeUsage; } - if (JavaAnnotationResolver.findAnnotationWithExternal(owner, JvmAbi.JETBRAINS_MUTABLE_ANNOTATION.getFqName().asString()) != null) { + if (JavaAnnotationResolver.findAnnotationWithExternal(owner, JvmAnnotationNames.JETBRAINS_MUTABLE_ANNOTATION.getFqName().asString()) != null) { return TypeUsage.MEMBER_SIGNATURE_COVARIANT; } - if (JavaAnnotationResolver.findAnnotationWithExternal(owner, JvmAbi.JETBRAINS_READONLY_ANNOTATION.getFqName().asString()) != null) { + if (JavaAnnotationResolver.findAnnotationWithExternal(owner, JvmAnnotationNames.JETBRAINS_READONLY_ANNOTATION.getFqName().asString()) != null) { return TypeUsage.MEMBER_SIGNATURE_CONTRAVARIANT; } return originalTypeUsage; diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java index a0951af01cb..1a0755379e5 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java @@ -20,7 +20,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.Name; -public class JvmAbi { +public final class JvmAbi { /** * This constant is used to identify binary format (class file) versions * If you change class file metadata format and/or naming conventions, please increase this number @@ -44,13 +44,7 @@ public class JvmAbi { public static final String INSTANCE_FIELD = "instance$"; public static final String CLASS_OBJECT_FIELD = "object$"; - public static final JvmClassName JETBRAINS_NOT_NULL_ANNOTATION = - JvmClassName.byFqNameWithoutInnerClasses("org.jetbrains.annotations.NotNull"); - - public static final JvmClassName JETBRAINS_MUTABLE_ANNOTATION = - JvmClassName.byFqNameWithoutInnerClasses("org.jetbrains.annotations.Mutable"); - public static final JvmClassName JETBRAINS_READONLY_ANNOTATION = - JvmClassName.byFqNameWithoutInnerClasses("org.jetbrains.annotations.ReadOnly"); + public static final JvmClassName JET_OBJECT = JvmClassName.byFqNameWithoutInnerClasses("jet.JetObject"); public static boolean isClassObjectFqName(@NotNull FqName fqName) { return fqName.lastSegmentIs(Name.identifier(CLASS_OBJECT_CLASS_NAME)); diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAnnotationNames.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAnnotationNames.java new file mode 100644 index 00000000000..f25ea13355f --- /dev/null +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAnnotationNames.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010-2013 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.jet.lang.resolve.java; + +import jet.KotlinClass; +import jet.KotlinPackage; +import jet.runtime.typeinfo.KotlinSignature; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver; + +public final class JvmAnnotationNames { + public static final JvmClassName KOTLIN_CLASS = JvmClassName.byClass(KotlinClass.class); + + public static final JvmClassName KOTLIN_PACKAGE = JvmClassName.byClass(KotlinPackage.class); + + public static final String ABI_VERSION_FIELD_NAME = "abiVersion"; + + public static final String DATA_FIELD_NAME = "data"; + @Deprecated + public static final JvmClassName OLD_JET_CLASS_ANNOTATION = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetClass"); + @Deprecated + public static final JvmClassName OLD_JET_PACKAGE_CLASS_ANNOTATION = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetPackageClass"); + + public static final JvmClassName ASSERT_INVISIBLE_IN_RESOLVER = JvmClassName.byClass(AssertInvisibleInResolver.class); + + public static final JvmClassName KOTLIN_SIGNATURE = JvmClassName.byClass(KotlinSignature.class); + + public static final String KOTLIN_SIGNATURE_VALUE_FIELD_NAME = "value"; + + public static final JvmClassName JETBRAINS_NOT_NULL_ANNOTATION = JvmClassName.byClass(NotNull.class); + + public static final JvmClassName JETBRAINS_MUTABLE_ANNOTATION = JvmClassName.byFqNameWithoutInnerClasses("org.jetbrains.annotations.Mutable"); + + public static final JvmClassName JETBRAINS_READONLY_ANNOTATION = JvmClassName.byFqNameWithoutInnerClasses("org.jetbrains.annotations.ReadOnly"); + + private JvmAnnotationNames() { + } +} diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmClassName.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmClassName.java index 4ea57d3534e..bb071f293b1 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmClassName.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmClassName.java @@ -58,6 +58,11 @@ public class JvmClassName { return byFqNameWithoutInnerClasses(new FqName(fqName)); } + @NotNull + public static JvmClassName byClass(@NotNull Class klass) { + return byFqNameWithoutInnerClasses(new FqName(klass.getCanonicalName())); + } + @NotNull public static JvmClassName bySignatureName(@NotNull String signatureName) { JvmClassName className = new JvmClassName(signatureNameToInternalName(signatureName)); diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmStdlibNames.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmStdlibNames.java deleted file mode 100644 index db7034affb7..00000000000 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmStdlibNames.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2010-2013 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.jet.lang.resolve.java; - -import jet.KotlinClass; -import jet.KotlinPackage; -import jet.runtime.typeinfo.JetConstructor; - -public class JvmStdlibNames { - - public static final JvmClassName JET_VALUE_PARAMETER = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetValueParameter"); - - public static final String JET_VALUE_PARAMETER_NAME_FIELD = "name"; - public static final String JET_VALUE_PARAMETER_HAS_DEFAULT_VALUE_FIELD = "hasDefaultValue"; - public static final String JET_VALUE_PARAMETER_TYPE_FIELD = "type"; - public static final String JET_VALUE_PARAMETER_RECEIVER_FIELD = "receiver"; - public static final String JET_VALUE_PARAMETER_VARARG = "vararg"; - - - public static final JvmClassName JET_TYPE_PARAMETER = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetTypeParameter"); - - - public static final JvmClassName JET_METHOD = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetMethod"); - - public static final String JET_FLAGS_FIELD = "flags"; - - public static final String JET_METHOD_RETURN_TYPE_FIELD = "returnType"; - public static final String JET_METHOD_TYPE_PARAMETERS_FIELD = "typeParameters"; - public static final String JET_METHOD_PROPERTY_TYPE_FIELD = "propertyType"; - - public static final int FLAGS_DEFAULT_VALUE = 0; - - public static final int FLAG_PROPERTY_BIT = 1; - public static final int FLAG_FORCE_OPEN_BIT = 1 << 1; - public static final int FLAG_FORCE_FINAL_BIT = 1 << 2; - public static final int FLAG_PRIVATE_BIT = 1 << 3; - public static final int FLAG_INTERNAL_BIT = 1 << 4; - public static final int FLAG_PROTECTED_BIT = 1 << 5; - - // for method, three bits (one reserved) - public static final int FLAG_METHOD_KIND_MASK = 7 << 6; - public static final int FLAG_METHOD_KIND_DECLARATION = 0 << 6; - public static final int FLAG_METHOD_KIND_FAKE_OVERRIDE = 1 << 6; - public static final int FLAG_METHOD_KIND_DELEGATION = 2 << 6; - public static final int FLAG_METHOD_KIND_SYNTHESIZED = 3 << 6; - - public static final int FLAG_CLASS_KIND_MASK = 7 << 6; - public static final int FLAG_CLASS_KIND_OBJECT = 1 << 6; - - public static final JvmClassName JET_CONSTRUCTOR = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetConstructor"); - - /** - * @deprecated - * @see JetConstructor#hidden() - */ - public static final String JET_CONSTRUCTOR_HIDDEN_FIELD = "hidden"; - - public static final JvmClassName KOTLIN_CLASS = JvmClassName.byFqNameWithoutInnerClasses(KotlinClass.class.getCanonicalName()); - - public static final JvmClassName KOTLIN_PACKAGE = JvmClassName.byFqNameWithoutInnerClasses(KotlinPackage.class.getCanonicalName()); - - public static final JvmClassName JET_CLASS = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetClass"); - - public static final JvmClassName JET_CLASS_OBJECT = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetClassObject"); - - public static final JvmClassName JET_PACKAGE_CLASS = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetPackageClass"); - - public static final String ABI_VERSION_NAME = "abiVersion"; - - public static final String JET_CLASS_SIGNATURE = "signature"; - - public static final JvmClassName JET_OBJECT = JvmClassName.byFqNameWithoutInnerClasses("jet.JetObject"); - - public static final JvmClassName ASSERT_INVISIBLE_IN_RESOLVER = JvmClassName.byFqNameWithoutInnerClasses("org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver"); - - public static final JvmClassName KOTLIN_SIGNATURE = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.KotlinSignature"); - - public static final String KOTLIN_SIGNATURE_VALUE_METHOD = "value"; - - public static final String KOTLIN_INFO_DATA_FIELD = "data"; - - private JvmStdlibNames() { - } -} diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/PsiClassFinderImpl.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/PsiClassFinderImpl.java index 916d71fb48a..4b406d4b85f 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/PsiClassFinderImpl.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/PsiClassFinderImpl.java @@ -106,7 +106,7 @@ public class PsiClassFinderImpl implements PsiClassFinder { if (KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME.equals(qualifiedName.parent())) { PsiAnnotation assertInvisibleAnnotation = JavaAnnotationResolver.findOwnAnnotation( - original, JvmStdlibNames.ASSERT_INVISIBLE_IN_RESOLVER.getFqName().asString()); + original, JvmAnnotationNames.ASSERT_INVISIBLE_IN_RESOLVER.getFqName().asString()); if (assertInvisibleAnnotation != null) { switch (runtimeClassesHandleMode) { diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kt/KotlinSignatureAnnotation.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kt/KotlinSignatureAnnotation.java index 319144d5198..1012efb7487 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kt/KotlinSignatureAnnotation.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kt/KotlinSignatureAnnotation.java @@ -21,7 +21,7 @@ import com.intellij.psi.PsiAnnotation; import com.intellij.psi.PsiModifierListOwner; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames; +import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import org.jetbrains.jet.lang.resolve.java.resolver.JavaAnnotationResolver; public class KotlinSignatureAnnotation extends PsiAnnotationWrapper { @@ -39,7 +39,7 @@ public class KotlinSignatureAnnotation extends PsiAnnotationWrapper { @Override protected void initialize() { - signature = StringUtil.unescapeStringCharacters(getStringAttribute(JvmStdlibNames.KOTLIN_SIGNATURE_VALUE_METHOD, "")); + signature = StringUtil.unescapeStringCharacters(getStringAttribute(JvmAnnotationNames.KOTLIN_SIGNATURE_VALUE_FIELD_NAME, "")); } @NotNull @@ -52,7 +52,7 @@ public class KotlinSignatureAnnotation extends PsiAnnotationWrapper { public static KotlinSignatureAnnotation get(PsiModifierListOwner psiModifierListOwner) { PsiAnnotation annotation = JavaAnnotationResolver - .findAnnotationWithExternal(psiModifierListOwner, JvmStdlibNames.KOTLIN_SIGNATURE.getFqName().asString()); + .findAnnotationWithExternal(psiModifierListOwner, JvmAnnotationNames.KOTLIN_SIGNATURE.getFqName().asString()); return annotation != null ? new KotlinSignatureAnnotation(annotation) : NULL_ANNOTATION; } } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java index c0ce11045d9..30f83544824 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/AnnotationDescriptorDeserializer.java @@ -151,8 +151,8 @@ public class AnnotationDescriptorDeserializer implements AnnotationDeserializer private static boolean ignoreAnnotation(@NotNull String desc) { // TODO: JvmAbi.JETBRAINS_NOT_NULL_ANNOTATION ? - return desc.equals(JvmStdlibNames.KOTLIN_CLASS.getDescriptor()) - || desc.equals(JvmStdlibNames.KOTLIN_PACKAGE.getDescriptor()) + return desc.equals(JvmAnnotationNames.KOTLIN_CLASS.getDescriptor()) + || desc.equals(JvmAnnotationNames.KOTLIN_PACKAGE.getDescriptor()) || desc.startsWith("Ljet/runtime/typeinfo/"); } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/DeserializedDescriptorResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/DeserializedDescriptorResolver.java index 69288df44f6..cbecb17c515 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/DeserializedDescriptorResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/DeserializedDescriptorResolver.java @@ -32,7 +32,7 @@ import org.jetbrains.jet.lang.descriptors.ClassOrNamespaceDescriptor; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; import org.jetbrains.jet.lang.resolve.java.AbiVersionUtil; -import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames; +import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.Name; @@ -222,15 +222,15 @@ public final class DeserializedDescriptorResolver { @Override public AnnotationVisitor visitAnnotation(final String desc, boolean visible) { - if (!desc.equals(JvmStdlibNames.KOTLIN_CLASS.getDescriptor()) && - !desc.equals(JvmStdlibNames.KOTLIN_PACKAGE.getDescriptor())) { + if (!desc.equals(JvmAnnotationNames.KOTLIN_CLASS.getDescriptor()) && + !desc.equals(JvmAnnotationNames.KOTLIN_PACKAGE.getDescriptor())) { return null; } return new AnnotationVisitor(Opcodes.ASM4) { @Override public void visit(String name, Object value) { - if (name.equals(JvmStdlibNames.ABI_VERSION_NAME)) { + if (name.equals(JvmAnnotationNames.ABI_VERSION_FIELD_NAME)) { version = (Integer) value; } else if (isAbiVersionCompatible(version)) { @@ -240,7 +240,7 @@ public final class DeserializedDescriptorResolver { @Override public AnnotationVisitor visitArray(String name) { - if (name.equals(JvmStdlibNames.KOTLIN_INFO_DATA_FIELD)) { + if (name.equals(JvmAnnotationNames.DATA_FIELD_NAME)) { return stringArrayVisitor(); } else if (isAbiVersionCompatible(version)) { diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaAnnotationResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaAnnotationResolver.java index 3a0106b667d..c95a32e5cd5 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaAnnotationResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaAnnotationResolver.java @@ -82,9 +82,9 @@ public final class JavaAnnotationResolver { // Don't process internal jet annotations and jetbrains NotNull annotations if (qname.startsWith("jet.runtime.typeinfo.") - || qname.equals(JvmAbi.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()) - || qname.equals(JvmStdlibNames.KOTLIN_CLASS.getFqName().asString()) - || qname.equals(JvmStdlibNames.KOTLIN_PACKAGE.getFqName().asString()) + || qname.equals(JvmAnnotationNames.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()) + || qname.equals(JvmAnnotationNames.KOTLIN_CLASS.getFqName().asString()) + || qname.equals(JvmAnnotationNames.KOTLIN_PACKAGE.getFqName().asString()) ) { return null; } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaFunctionResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaFunctionResolver.java index 53e8cc06d40..be4c73361c3 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaFunctionResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaFunctionResolver.java @@ -415,7 +415,7 @@ public final class JavaFunctionResolver { JetType transformedType = typeTransformer.transformToType(returnType, typeUsage, typeVariableResolver); if (JavaAnnotationResolver - .findAnnotationWithExternal(method.getPsiMethod(), JvmAbi.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()) != + .findAnnotationWithExternal(method.getPsiMethod(), JvmAnnotationNames.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()) != null) { return TypeUtils.makeNullableAsSpecified(transformedType, false); } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaNamespaceResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaNamespaceResolver.java index 9ff4935cdeb..2aff4bebbae 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaNamespaceResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaNamespaceResolver.java @@ -202,7 +202,8 @@ public final class JavaNamespaceResolver { } private static boolean isOldKotlinPackageClass(@NotNull PsiClass psiClass) { - return DescriptorResolverUtils.hasAnnotation(psiClass, JvmStdlibNames.JET_PACKAGE_CLASS.getFqName()); + //noinspection deprecation + return DescriptorResolverUtils.hasAnnotation(psiClass, JvmAnnotationNames.OLD_JET_PACKAGE_CLASS_ANNOTATION.getFqName()); } private void cache(@NotNull FqName fqName, @Nullable JetScope packageScope) { diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaPropertyResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaPropertyResolver.java index 45067a08edc..23f242269a3 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaPropertyResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaPropertyResolver.java @@ -255,7 +255,7 @@ public final class JavaPropertyResolver { boolean hasNotNullAnnotation = JavaAnnotationResolver.findAnnotationWithExternal( field.getPsiField(), - JvmAbi.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()) != null; + JvmAnnotationNames.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()) != null; if (hasNotNullAnnotation || isStaticFinalField(field)) { propertyType = TypeUtils.makeNotNullable(propertyType); diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaSupertypeResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaSupertypeResolver.java index 1c5de0ff76d..d5c92ef4c25 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaSupertypeResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaSupertypeResolver.java @@ -120,7 +120,7 @@ public final class JavaSupertypeResolver { if (resolved != null) { String qualifiedName = resolved.getQualifiedName(); assert qualifiedName != null; - if (JvmStdlibNames.JET_OBJECT.getFqName().equalsTo(qualifiedName)) { + if (JvmAbi.JET_OBJECT.getFqName().equalsTo(qualifiedName)) { continue; } } diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaValueParameterResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaValueParameterResolver.java index 04769ccd315..432b5d02ac7 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaValueParameterResolver.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/resolver/JavaValueParameterResolver.java @@ -70,8 +70,8 @@ public final class JavaValueParameterResolver { } JetType transformedType; - PsiAnnotation notNullAnnotation = findAnnotationWithExternal(parameter, - JvmAbi.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()); + PsiAnnotation notNullAnnotation = + findAnnotationWithExternal(parameter, JvmAnnotationNames.JETBRAINS_NOT_NULL_ANNOTATION.getFqName().asString()); if (notNullAnnotation != null) { transformedType = TypeUtils.makeNullableAsSpecified(outType, false); } diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java index 79b2d1f6c8a..56df4d06c23 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java @@ -29,9 +29,6 @@ import java.util.List; import static org.jetbrains.jet.jvm.compiler.LoadDescriptorUtil.compileKotlinToDirAndGetAnalyzeExhaust; -/** - * @see WriteSignatureTest - */ @SuppressWarnings({"JUnitTestCaseWithNonTrivialConstructors", "JUnitTestCaseWithNoTests"}) public abstract class AbstractCompileJavaAgainstKotlinTest extends TestCaseWithTmpdir { protected void doTest(String ktFilePath) throws Exception { diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/IdeaJdkAnnotationsReflectedTest.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/IdeaJdkAnnotationsReflectedTest.java index d65fe3c89e0..e5fd93aa1c3 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/IdeaJdkAnnotationsReflectedTest.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/IdeaJdkAnnotationsReflectedTest.java @@ -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.JvmStdlibNames; +import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import org.jetbrains.jet.lang.resolve.lazy.KotlinTestWithEnvironment; import org.jetbrains.jet.lang.resolve.name.FqName; @@ -158,9 +158,9 @@ public class IdeaJdkAnnotationsReflectedTest extends KotlinTestWithEnvironment { } private enum AnnotationsKind { - KOTLIN_SIGNATURE(JvmStdlibNames.KOTLIN_SIGNATURE.getFqName().asString()), + KOTLIN_SIGNATURE(JvmAnnotationNames.KOTLIN_SIGNATURE.getFqName().asString()), NOT_NULL(AnnotationUtil.NOT_NULL), - ANY(AnnotationUtil.NOT_NULL, JvmStdlibNames.KOTLIN_SIGNATURE.getFqName().asString()); + ANY(AnnotationUtil.NOT_NULL, JvmAnnotationNames.KOTLIN_SIGNATURE.getFqName().asString()); public final String[] annotationNames; diff --git a/idea/src/org/jetbrains/jet/plugin/ktSignature/KotlinSignatureUtil.java b/idea/src/org/jetbrains/jet/plugin/ktSignature/KotlinSignatureUtil.java index 2b1070fe8ac..ea2a2e81546 100644 --- a/idea/src/org/jetbrains/jet/plugin/ktSignature/KotlinSignatureUtil.java +++ b/idea/src/org/jetbrains/jet/plugin/ktSignature/KotlinSignatureUtil.java @@ -26,11 +26,11 @@ import com.intellij.psi.impl.compiled.ClsElementImpl; import com.intellij.psi.impl.source.SourceTreeToPsiMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames; +import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import org.jetbrains.jet.lang.resolve.java.resolver.JavaAnnotationResolver; class KotlinSignatureUtil { - static final String KOTLIN_SIGNATURE_ANNOTATION = JvmStdlibNames.KOTLIN_SIGNATURE.getFqName().asString(); + static final String KOTLIN_SIGNATURE_ANNOTATION = JvmAnnotationNames.KOTLIN_SIGNATURE.getFqName().asString(); private KotlinSignatureUtil() { } diff --git a/idea/src/org/jetbrains/jet/plugin/versions/KotlinAbiVersionIndex.java b/idea/src/org/jetbrains/jet/plugin/versions/KotlinAbiVersionIndex.java index 4eac709d045..aa4393848e7 100644 --- a/idea/src/org/jetbrains/jet/plugin/versions/KotlinAbiVersionIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/versions/KotlinAbiVersionIndex.java @@ -30,7 +30,7 @@ import org.jetbrains.asm4.ClassReader; import org.jetbrains.asm4.ClassVisitor; import org.jetbrains.asm4.Opcodes; import org.jetbrains.jet.lang.resolve.java.AbiVersionUtil; -import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames; +import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames; import java.util.Map; @@ -63,19 +63,20 @@ public class KotlinAbiVersionIndex extends ScalarIndexExtension { try { ClassReader classReader = new ClassReader(inputData.getContent()); classReader.accept(new ClassVisitor(Opcodes.ASM4) { + @SuppressWarnings("deprecation") @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { - if (!JvmStdlibNames.JET_CLASS.getDescriptor().equals(desc) && - !JvmStdlibNames.JET_PACKAGE_CLASS.getDescriptor().equals(desc) && - !JvmStdlibNames.KOTLIN_CLASS.getDescriptor().equals(desc) && - !JvmStdlibNames.KOTLIN_PACKAGE.getDescriptor().equals(desc)) { + if (!JvmAnnotationNames.OLD_JET_CLASS_ANNOTATION.getDescriptor().equals(desc) && + !JvmAnnotationNames.OLD_JET_PACKAGE_CLASS_ANNOTATION.getDescriptor().equals(desc) && + !JvmAnnotationNames.KOTLIN_CLASS.getDescriptor().equals(desc) && + !JvmAnnotationNames.KOTLIN_PACKAGE.getDescriptor().equals(desc)) { return null; } annotationPresent.set(true); return new AnnotationVisitor(Opcodes.ASM4) { @Override public void visit(String name, Object value) { - if (JvmStdlibNames.ABI_VERSION_NAME.equals(name)) { + if (JvmAnnotationNames.ABI_VERSION_FIELD_NAME.equals(name)) { if (value instanceof Integer) { Integer abiVersion = (Integer) value; result.put(abiVersion, null); diff --git a/runtime/src/jet/runtime/typeinfo/JetClass.java b/runtime/src/jet/runtime/typeinfo/JetClass.java deleted file mode 100644 index 6593cd8b6f4..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetClass.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * @url http://confluence.jetbrains.net/display/JET/Jet+Signatures - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface JetClass { - String signature(); - - /** - * See JvmStdlibNames - * @return flags for class - */ - int flags() default 0; - - int abiVersion(); -} diff --git a/runtime/src/jet/runtime/typeinfo/JetClassObject.java b/runtime/src/jet/runtime/typeinfo/JetClassObject.java deleted file mode 100644 index ab887f5d4fd..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetClassObject.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -public @interface JetClassObject { - -} diff --git a/runtime/src/jet/runtime/typeinfo/JetConstructor.java b/runtime/src/jet/runtime/typeinfo/JetConstructor.java deleted file mode 100644 index 7c0e2f38754..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetConstructor.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -public @interface JetConstructor { - /** - * @deprecated Some time later all constructors will be visible - */ - boolean hidden() default false; - - /** - * See JvmStdlibNames - * @return flags for method - */ - int flags() default 0; -} diff --git a/runtime/src/jet/runtime/typeinfo/JetMethod.java b/runtime/src/jet/runtime/typeinfo/JetMethod.java deleted file mode 100644 index 8b9cf8664c9..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetMethod.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation for method - * - * The fact of receiver presence must be deducted from presence of '$receiver' parameter - * - * @url http://confluence.jetbrains.net/display/JET/Jet+Signatures - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface JetMethod { - /** - * See CallableMemberDescriptor.Kind - * @deprecated See JvmStdlibNames - now kind is kept in flags - * @return kind of this method - */ - int kind() default 0; - - /** - * See JvmStdlibNames - * @return flags for method - */ - int flags() default 0; - - /** - * @deprecated not used any more - * @return type projections or empty - */ - JetTypeProjection[] returnTypeProjections() default {}; - - /** - * Serialized method type parameters. - * @return - */ - String typeParameters() default ""; - - /** - * @deprecated - now it kept in flags - * @return is this type returnTypeNullable - */ - boolean nullableReturnType() default false; - - /** - * Return type type unless java type is correct Kotlin type. - */ - String returnType () default ""; - - /** - * If this is property. - * @return - */ - String propertyType() default ""; -} diff --git a/runtime/src/jet/runtime/typeinfo/JetPackageClass.java b/runtime/src/jet/runtime/typeinfo/JetPackageClass.java deleted file mode 100644 index cb89663957f..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetPackageClass.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * @url http://confluence.jetbrains.net/display/JET/Jet+Signatures - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface JetPackageClass { - int abiVersion(); -} diff --git a/runtime/src/jet/runtime/typeinfo/JetTypeDescriptor.java b/runtime/src/jet/runtime/typeinfo/JetTypeDescriptor.java deleted file mode 100644 index a85a1915e26..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetTypeDescriptor.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - - -/** - * @url http://confluence.jetbrains.net/display/JET/Jet+Signatures - */ -public @interface JetTypeDescriptor{ - // - // case of type parameter - // - String varName() default ""; - boolean reified () default true; - int [] upperBounds() default {}; - - // - // case of real type - // - Class javaClass() default Object.class; - JetTypeProjection [] projections() default {}; -} diff --git a/runtime/src/jet/runtime/typeinfo/JetTypeParameter.java b/runtime/src/jet/runtime/typeinfo/JetTypeParameter.java deleted file mode 100644 index 8bc327d5d2c..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetTypeParameter.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation for parameters - * - * @url http://confluence.jetbrains.net/display/JET/Jet+Signatures - */ -@Target({ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -public @interface JetTypeParameter { - /** - * @return name of parameter - */ - String name() default ""; -} diff --git a/runtime/src/jet/runtime/typeinfo/JetTypeProjection.java b/runtime/src/jet/runtime/typeinfo/JetTypeProjection.java deleted file mode 100644 index c4e9561052f..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetTypeProjection.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * @url http://confluence.jetbrains.net/display/JET/Jet+Signatures - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface JetTypeProjection { - - /** - * @return index of the class in the per class table of JetTypeDescriptor - */ - int typeDescriptorIndex(); -} diff --git a/runtime/src/jet/runtime/typeinfo/JetValueParameter.java b/runtime/src/jet/runtime/typeinfo/JetValueParameter.java deleted file mode 100644 index ada2cd0da1f..00000000000 --- a/runtime/src/jet/runtime/typeinfo/JetValueParameter.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2010-2013 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 jet.runtime.typeinfo; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation for parameters - * - * @url http://confluence.jetbrains.net/display/JET/Jet+Signatures - */ -@Target({ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -public @interface JetValueParameter { - /** - * @return name of parameter - */ - String name (); - - /** - * @return if this parameter has default value - */ - boolean hasDefaultValue() default false; - - /** - * @return if this parameter is receiver - */ - boolean receiver() default false; - - /** - * @return type unless Java type is correct Kotlin type. - */ - String type() default ""; - - /** - * @return true if this parameter is a vararg - * - * NOTE: a method may have a vararg parameter in Kotlin and not be marked as Opcodes.ACC_VARARGS, e.g. - * fun foo(vararg x: Int, f: () -> Unit) - */ - boolean vararg() default false; -}