Delete remains of external annotations support from compiler
This commit is contained in:
-36
@@ -1,36 +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.load.java.components;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaAnnotation;
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaAnnotationOwner;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
|
||||
public interface ExternalAnnotationResolver {
|
||||
ExternalAnnotationResolver EMPTY = new ExternalAnnotationResolver() {
|
||||
@Nullable
|
||||
@Override
|
||||
public JavaAnnotation findExternalAnnotation(@NotNull JavaAnnotationOwner owner, @NotNull FqName fqName) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
@Nullable
|
||||
JavaAnnotation findExternalAnnotation(@NotNull JavaAnnotationOwner owner, @NotNull FqName fqName);
|
||||
}
|
||||
@@ -36,9 +36,6 @@ class LazyJavaAnnotations(
|
||||
annotationOwner.findAnnotation(fqName)?.let(annotationDescriptors)
|
||||
?: JavaAnnotationMapper.findMappedJavaAnnotation(fqName, annotationOwner, c)
|
||||
|
||||
override fun findExternalAnnotation(fqName: FqName) =
|
||||
c.components.externalAnnotationResolver.findExternalAnnotation(annotationOwner, fqName)?.let(annotationDescriptors)
|
||||
|
||||
override fun getUseSiteTargetedAnnotations() = emptyList<AnnotationWithTarget>()
|
||||
|
||||
override fun getAllAnnotations() = this.map { AnnotationWithTarget(it, null) }
|
||||
|
||||
@@ -24,7 +24,10 @@ import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.load.java.AnnotationTypeQualifierResolver
|
||||
import org.jetbrains.kotlin.load.java.JavaClassFinder
|
||||
import org.jetbrains.kotlin.load.java.JavaClassesTracker
|
||||
import org.jetbrains.kotlin.load.java.components.*
|
||||
import org.jetbrains.kotlin.load.java.components.JavaPropertyInitializerEvaluator
|
||||
import org.jetbrains.kotlin.load.java.components.JavaResolverCache
|
||||
import org.jetbrains.kotlin.load.java.components.SamConversionResolver
|
||||
import org.jetbrains.kotlin.load.java.components.SignaturePropagator
|
||||
import org.jetbrains.kotlin.load.java.lazy.types.JavaTypeResolver
|
||||
import org.jetbrains.kotlin.load.java.sources.JavaSourceElementFactory
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaTypeParameterListOwner
|
||||
@@ -42,7 +45,6 @@ class JavaResolverComponents(
|
||||
val finder: JavaClassFinder,
|
||||
val kotlinClassFinder: KotlinClassFinder,
|
||||
val deserializedDescriptorResolver: DeserializedDescriptorResolver,
|
||||
val externalAnnotationResolver: ExternalAnnotationResolver,
|
||||
val signaturePropagator: SignaturePropagator,
|
||||
val errorReporter: ErrorReporter,
|
||||
val javaResolverCache: JavaResolverCache,
|
||||
@@ -63,7 +65,7 @@ class JavaResolverComponents(
|
||||
javaResolverCache: JavaResolverCache = this.javaResolverCache
|
||||
) = JavaResolverComponents(
|
||||
storageManager, finder, kotlinClassFinder, deserializedDescriptorResolver,
|
||||
externalAnnotationResolver, signaturePropagator, errorReporter, javaResolverCache,
|
||||
signaturePropagator, errorReporter, javaResolverCache,
|
||||
javaPropertyInitializerEvaluator, samConversionResolver, sourceElementFactory,
|
||||
moduleClassResolver, packageMapper, supertypeLoopChecker, lookupTracker, module, reflectionTypes,
|
||||
annotationTypeQualifierResolver, signatureEnhancement, javaClassesTracker
|
||||
|
||||
+5
-2
@@ -24,7 +24,10 @@ import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.load.java.AnnotationTypeQualifierResolver
|
||||
import org.jetbrains.kotlin.load.java.JavaClassesTracker
|
||||
import org.jetbrains.kotlin.load.java.components.*
|
||||
import org.jetbrains.kotlin.load.java.components.JavaPropertyInitializerEvaluator
|
||||
import org.jetbrains.kotlin.load.java.components.JavaResolverCache
|
||||
import org.jetbrains.kotlin.load.java.components.SamConversionResolver
|
||||
import org.jetbrains.kotlin.load.java.components.SignaturePropagator
|
||||
import org.jetbrains.kotlin.load.java.lazy.JavaResolverComponents
|
||||
import org.jetbrains.kotlin.load.java.lazy.LazyJavaPackageFragmentProvider
|
||||
import org.jetbrains.kotlin.load.java.lazy.SingleModuleClassResolver
|
||||
@@ -63,7 +66,7 @@ class RuntimeModuleData private constructor(
|
||||
val annotationTypeQualifierResolver = AnnotationTypeQualifierResolver(storageManager, Jsr305State.DISABLED)
|
||||
val globalJavaResolverContext = JavaResolverComponents(
|
||||
storageManager, ReflectJavaClassFinder(classLoader), reflectKotlinClassFinder, deserializedDescriptorResolver,
|
||||
ExternalAnnotationResolver.EMPTY, SignaturePropagator.DO_NOTHING, RuntimeErrorReporter, javaResolverCache,
|
||||
SignaturePropagator.DO_NOTHING, RuntimeErrorReporter, javaResolverCache,
|
||||
JavaPropertyInitializerEvaluator.DoNothing, SamConversionResolver.Empty, RuntimeSourceElementFactory, singleModuleClassResolver,
|
||||
runtimePackagePartProvider, SupertypeLoopChecker.EMPTY, LookupTracker.DO_NOTHING, module,
|
||||
ReflectionTypes(module, notFoundClasses),
|
||||
|
||||
@@ -30,8 +30,6 @@ interface Annotations : Iterable<AnnotationDescriptor> {
|
||||
|
||||
fun hasAnnotation(fqName: FqName): Boolean = findAnnotation(fqName) != null
|
||||
|
||||
fun findExternalAnnotation(fqName: FqName): AnnotationDescriptor? = null
|
||||
|
||||
fun getUseSiteTargetedAnnotations(): List<AnnotationWithTarget>
|
||||
|
||||
// Returns both targeted and annotations without target. Annotation order is preserved.
|
||||
@@ -81,10 +79,6 @@ class FilteredAnnotations(
|
||||
if (fqNameFilter(fqName)) delegate.findAnnotation(fqName)
|
||||
else null
|
||||
|
||||
override fun findExternalAnnotation(fqName: FqName) =
|
||||
if (fqNameFilter(fqName)) delegate.findExternalAnnotation(fqName)
|
||||
else null
|
||||
|
||||
override fun getUseSiteTargetedAnnotations(): List<AnnotationWithTarget> {
|
||||
return delegate.getUseSiteTargetedAnnotations().filter { shouldBeReturned(it.annotation) }
|
||||
}
|
||||
@@ -114,8 +108,6 @@ class CompositeAnnotations(
|
||||
|
||||
override fun findAnnotation(fqName: FqName) = delegates.asSequence().mapNotNull { it.findAnnotation(fqName) }.firstOrNull()
|
||||
|
||||
override fun findExternalAnnotation(fqName: FqName) = delegates.asSequence().mapNotNull { it.findExternalAnnotation(fqName) }.firstOrNull()
|
||||
|
||||
override fun getUseSiteTargetedAnnotations() = delegates.flatMap { it.getUseSiteTargetedAnnotations() }
|
||||
|
||||
override fun getAllAnnotations() = delegates.flatMap { it.getAllAnnotations() }
|
||||
|
||||
Reference in New Issue
Block a user