Extract method

This commit is contained in:
Andrey Breslav
2013-11-11 13:16:01 +04:00
parent 1795b2a0bc
commit 641ed568f2
@@ -105,11 +105,7 @@ public final class JavaAnnotationResolver {
} }
// Don't process internal jet annotations and jetbrains NotNull annotations // Don't process internal jet annotations and jetbrains NotNull annotations
if (fqName.asString().startsWith("jet.runtime.typeinfo.") if (isSpecialAnnotation(fqName)) {
|| fqName.equals(JETBRAINS_NOT_NULL_ANNOTATION)
|| fqName.equals(JvmAnnotationNames.KOTLIN_CLASS)
|| fqName.equals(JvmAnnotationNames.KOTLIN_PACKAGE)
) {
return null; return null;
} }
@@ -146,6 +142,13 @@ public final class JavaAnnotationResolver {
return annotation; return annotation;
} }
public static boolean isSpecialAnnotation(@NotNull FqName fqName) {
return fqName.asString().startsWith("jet.runtime.typeinfo.")
|| fqName.equals(JETBRAINS_NOT_NULL_ANNOTATION)
|| fqName.equals(JvmAnnotationNames.KOTLIN_CLASS)
|| fqName.equals(JvmAnnotationNames.KOTLIN_PACKAGE);
}
@Nullable @Nullable
public JavaAnnotation findAnnotationWithExternal(@NotNull JavaAnnotationOwner owner, @NotNull FqName name) { public JavaAnnotation findAnnotationWithExternal(@NotNull JavaAnnotationOwner owner, @NotNull FqName name) {
JavaAnnotation annotation = owner.findAnnotation(name); JavaAnnotation annotation = owner.findAnnotation(name);