From fa08289706343bdf12ee3709e84e886b4baf0f8c Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 15 Jan 2013 17:59:48 +0400 Subject: [PATCH] Refactoring: remove warning and use constant --- .../jet/lang/resolve/java/PsiClassFinderImpl.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 a64d40cfb28..1924c8e9e7b 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 @@ -30,6 +30,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.resolve.java.resolver.JavaAnnotationResolver; import org.jetbrains.jet.lang.resolve.name.FqName; +import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; import org.jetbrains.jet.plugin.JetFileType; import javax.annotation.PostConstruct; @@ -85,8 +86,9 @@ public class PsiClassFinderImpl implements PsiClassFinder { PsiClass original = javaFacade.findClass(qualifiedName.getFqName(), javaSearchScope); if (original != null) { - FqName actualQualifiedName = new FqName(original.getQualifiedName()); - if (!actualQualifiedName.equals(qualifiedName)) { + String classQualifiedName = original.getQualifiedName(); + FqName actualQualifiedName = classQualifiedName != null ? new FqName(classQualifiedName) : null; + if (!qualifiedName.equals(actualQualifiedName)) { throw new IllegalStateException("requested " + qualifiedName + ", got " + actualQualifiedName); } } @@ -99,9 +101,10 @@ public class PsiClassFinderImpl implements PsiClassFinder { return null; } - if ("jet".equals(qualifiedName.parent().getFqName())) { - PsiAnnotation assertInvisibleAnnotation = - JavaAnnotationResolver.findOwnAnnotation(original, JvmStdlibNames.ASSERT_INVISIBLE_IN_RESOLVER.getFqName().getFqName()); + if (KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME.equals(qualifiedName.parent())) { + PsiAnnotation assertInvisibleAnnotation = JavaAnnotationResolver.findOwnAnnotation( + original, JvmStdlibNames.ASSERT_INVISIBLE_IN_RESOLVER.getFqName().getFqName()); + if (assertInvisibleAnnotation != null) { if (runtimeClassesHandleMode == RuntimeClassesHandleMode.IGNORE) { return null;