Refactoring: AnnotationTargetChecker --> AnnotationChecker
This commit is contained in:
@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.descriptors.annotations.*;
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.resolve.AnnotationTargetChecker;
|
||||
import org.jetbrains.kotlin.resolve.AnnotationChecker;
|
||||
import org.jetbrains.kotlin.resolve.constants.*;
|
||||
import org.jetbrains.kotlin.resolve.constants.StringValue;
|
||||
import org.jetbrains.kotlin.types.Flexibility;
|
||||
@@ -187,7 +187,7 @@ public abstract class AnnotationCodegen {
|
||||
private void generateTargetAnnotation(@NotNull ClassDescriptor classDescriptor, @NotNull Set<String> annotationDescriptorsAlreadyPresent) {
|
||||
String descriptor = Type.getType(Target.class).getDescriptor();
|
||||
if (!annotationDescriptorsAlreadyPresent.add(descriptor)) return;
|
||||
Set<KotlinTarget> targets = AnnotationTargetChecker.INSTANCE$.possibleTargetSet(classDescriptor);
|
||||
Set<KotlinTarget> targets = AnnotationChecker.INSTANCE$.possibleTargetSet(classDescriptor);
|
||||
Set<ElementType> javaTargets;
|
||||
if (targets == null) {
|
||||
javaTargets = getJavaTargetList(classDescriptor);
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.descriptors.annotations.KotlinTarget
|
||||
import org.jetbrains.kotlin.resolve.constants.BooleanValue
|
||||
import kotlin.annotation
|
||||
|
||||
public object AnnotationTargetChecker {
|
||||
public object AnnotationChecker {
|
||||
|
||||
public fun check(annotated: JetAnnotated, trace: BindingTrace, descriptor: ClassDescriptor? = null) {
|
||||
if (annotated is JetTypeParameter) return // TODO: support type parameter annotations
|
||||
@@ -61,7 +61,7 @@ public class DeclarationsChecker {
|
||||
public void process(@NotNull BodiesResolveContext bodiesResolveContext) {
|
||||
for (JetFile file : bodiesResolveContext.getFiles()) {
|
||||
checkModifiersAndAnnotationsInPackageDirective(file);
|
||||
AnnotationTargetChecker.INSTANCE$.check(file, trace, null);
|
||||
AnnotationChecker.INSTANCE$.check(file, trace, null);
|
||||
}
|
||||
|
||||
Map<JetClassOrObject, ClassDescriptorWithResolutionScopes> classes = bodiesResolveContext.getDeclaredClasses();
|
||||
@@ -141,7 +141,7 @@ public class DeclarationsChecker {
|
||||
}
|
||||
}
|
||||
}
|
||||
AnnotationTargetChecker.INSTANCE$.check(packageDirective, trace, null);
|
||||
AnnotationChecker.INSTANCE$.check(packageDirective, trace, null);
|
||||
|
||||
modifiersChecker.reportIllegalModifiers(modifierList, Arrays.asList(JetTokens.MODIFIER_KEYWORDS_ARRAY));
|
||||
}
|
||||
@@ -303,7 +303,7 @@ public class DeclarationsChecker {
|
||||
if (typeParameter != null) {
|
||||
DescriptorResolver.checkConflictingUpperBounds(trace, typeParameter, jetTypeParameter);
|
||||
}
|
||||
AnnotationTargetChecker.INSTANCE$.check(jetTypeParameter, trace, null);
|
||||
AnnotationChecker.INSTANCE$.check(jetTypeParameter, trace, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ public class ModifiersChecker {
|
||||
}
|
||||
checkPlatformNameApplicability(descriptor);
|
||||
runDeclarationCheckers(modifierListOwner, descriptor);
|
||||
AnnotationTargetChecker.INSTANCE$.check(modifierListOwner, trace,
|
||||
AnnotationChecker.INSTANCE$.check(modifierListOwner, trace,
|
||||
descriptor instanceof ClassDescriptor ? (ClassDescriptor) descriptor : null);
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class ModifiersChecker {
|
||||
reportIllegalVisibilityModifiers(modifierListOwner);
|
||||
checkPlatformNameApplicability(descriptor);
|
||||
runDeclarationCheckers(modifierListOwner, descriptor);
|
||||
AnnotationTargetChecker.INSTANCE$.check(modifierListOwner, trace,
|
||||
AnnotationChecker.INSTANCE$.check(modifierListOwner, trace,
|
||||
descriptor instanceof ClassDescriptor ? (ClassDescriptor) descriptor : null);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticUtils;
|
||||
import org.jetbrains.kotlin.diagnostics.Errors;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
import org.jetbrains.kotlin.resolve.AnnotationTargetChecker;
|
||||
import org.jetbrains.kotlin.resolve.AnnotationChecker;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.BindingContextUtils;
|
||||
import org.jetbrains.kotlin.resolve.scopes.WritableScope;
|
||||
@@ -128,7 +128,7 @@ public abstract class ExpressionTypingVisitorDispatcher extends JetVisitor<JetTy
|
||||
@NotNull
|
||||
public final JetTypeInfo getTypeInfo(@NotNull JetExpression expression, ExpressionTypingContext context) {
|
||||
JetTypeInfo result = getTypeInfo(expression, context, this);
|
||||
AnnotationTargetChecker.INSTANCE$.checkExpression(expression, context.trace);
|
||||
AnnotationChecker.INSTANCE$.checkExpression(expression, context.trace);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user