Supporting FqNames with spaces/comments inside them for deprecated

This commit is contained in:
Andrey Breslav
2013-01-17 12:13:29 +04:00
parent a7531926a4
commit 3e02764603
6 changed files with 53 additions and 9 deletions
@@ -345,15 +345,13 @@ public class KotlinLightClassForExplicitDeclaration extends AbstractLightClass i
if (typeReference == null) continue;
JetTypeElement typeElement = typeReference.getTypeElement();
if (typeElement == null) continue;
if (!(typeElement instanceof JetUserType)) continue; // If it's not a user type, it's definitely not a ref to deprecated
// typeElement.getText() is either
// simple name => we just compare it to "deprecated"
// qualified name => we compare to FqName, there may be spaces, comments etc, we do not support these cases
// function type, etc => comparisons below fail
String text = typeElement.getText();
if (deprecatedFqName.getFqName().equals(text)) return true;
if (deprecatedName.equals(text)) return true;
FqName fqName = JetPsiUtil.toQualifiedName((JetUserType) typeElement);
if (fqName == null) continue;
if (deprecatedFqName.equals(fqName.toUnsafe())) return true;
if (deprecatedName.equals(fqName.getFqName())) return true;
}
return false;
}