Drop Annotations.findAnyAnnotation, DescriptorUtils.getAnnotationByFqName
This commit is contained in:
@@ -56,12 +56,8 @@ public abstract class AnnotationCodegen {
|
||||
this.jvmFlag = jvmFlag;
|
||||
}
|
||||
|
||||
public boolean hasAnnotation(@NotNull Annotated annotated) {
|
||||
return Annotations.Companion.findAnyAnnotation(annotated.getAnnotations(), fqName) != null;
|
||||
}
|
||||
|
||||
public int getJvmFlag() {
|
||||
return jvmFlag;
|
||||
public int getJvmFlag(@Nullable Annotated annotated) {
|
||||
return annotated != null && annotated.getAnnotations().hasAnnotation(fqName) ? jvmFlag : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,9 +225,7 @@ public class AsmUtil {
|
||||
int flags = getCommonCallableFlags(functionDescriptor, state);
|
||||
|
||||
for (AnnotationCodegen.JvmFlagAnnotation flagAnnotation : AnnotationCodegen.METHOD_FLAGS) {
|
||||
if (flagAnnotation.hasAnnotation(functionDescriptor.getOriginal())) {
|
||||
flags |= flagAnnotation.getJvmFlag();
|
||||
}
|
||||
flags |= flagAnnotation.getJvmFlag(functionDescriptor.getOriginal());
|
||||
}
|
||||
|
||||
if (functionDescriptor.getOriginal().isExternal()) {
|
||||
|
||||
@@ -370,9 +370,7 @@ public class PropertyCodegen {
|
||||
int modifiers = getDeprecatedAccessFlag(propertyDescriptor);
|
||||
|
||||
for (AnnotationCodegen.JvmFlagAnnotation flagAnnotation : AnnotationCodegen.FIELD_FLAGS) {
|
||||
if (annotatedField != null && flagAnnotation.hasAnnotation(annotatedField)) {
|
||||
modifiers |= flagAnnotation.getJvmFlag();
|
||||
}
|
||||
modifiers |= flagAnnotation.getJvmFlag(annotatedField);
|
||||
}
|
||||
|
||||
if (kind == OwnerKind.PACKAGE) {
|
||||
|
||||
Reference in New Issue
Block a user