Remove some usages of KotlinBuiltIns.getInstance()

Introduce DeclarationDescriptor.builtIns extension to get builtins where descriptors are available
Introduce various utilities in KotlinBuiltIns to check for primitive types and get fq names of builtins
This commit is contained in:
Pavel V. Talanov
2015-04-23 15:40:16 +03:00
parent 21d9c272c9
commit ac2cb9af74
71 changed files with 334 additions and 288 deletions
@@ -477,9 +477,8 @@ public class KotlinLightClassForExplicitDeclaration extends KotlinWrappingLightC
return false;
}
ClassDescriptor deprecatedAnnotation = KotlinBuiltIns.getInstance().getDeprecatedAnnotation();
String deprecatedName = deprecatedAnnotation.getName().asString();
FqNameUnsafe deprecatedFqName = DescriptorUtils.getFqName(deprecatedAnnotation);
FqName deprecatedFqName = KotlinBuiltIns.FQ_NAMES.deprecated;
String deprecatedName = deprecatedFqName.shortName().asString();
for (JetAnnotationEntry annotationEntry : jetModifierList.getAnnotationEntries()) {
JetTypeReference typeReference = annotationEntry.getTypeReference();
@@ -491,7 +490,7 @@ public class KotlinLightClassForExplicitDeclaration extends KotlinWrappingLightC
FqName fqName = JetPsiUtil.toQualifiedName((JetUserType) typeElement);
if (fqName == null) continue;
if (deprecatedFqName.equals(fqName.toUnsafe())) return true;
if (deprecatedFqName.equals(fqName)) return true;
if (deprecatedName.equals(fqName.asString())) return true;
}
return false;