add 'isSafe' to FqNameUnsafe

This commit is contained in:
Svetlana Isakova
2012-08-28 18:52:25 +04:00
parent e70db866ad
commit 22227663de
2 changed files with 8 additions and 1 deletions
@@ -62,7 +62,7 @@ public class FqName extends FqNameBase {
}
}
private static boolean isValidAfterUnsafeCheck(@NotNull String qualifiedName) {
/*package*/ static boolean isValidAfterUnsafeCheck(@NotNull String qualifiedName) {
// TODO: There's a valid name with escape char ``
return qualifiedName.indexOf('<') < 0;
}
@@ -91,6 +91,13 @@ public class FqNameUnsafe extends FqNameBase {
return fqName;
}
public boolean isSafe() {
if (safe != null) {
return true;
}
return FqName.isValidAfterUnsafeCheck(getFqName());
}
@NotNull
public FqName toSafe() {
if (safe != null) {