mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-psi] ClsAnnotationImpl#hasQualifiedName: extract qualifiedName.length() + 1 to variable, explanatory comment
GitOrigin-RevId: 628d6df97d5b96e17406835081a5fb8bae9fbc71
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2f16298ef2
commit
80c48a2ce6
@@ -72,8 +72,10 @@ public final class ClsAnnotationImpl extends ClsRepositoryPsiElement<PsiAnnotati
|
||||
@Override
|
||||
public boolean hasQualifiedName(@NotNull String qualifiedName) {
|
||||
String text = getStub().getText();
|
||||
return text.startsWith(qualifiedName, 1) &&
|
||||
(text.length() == qualifiedName.length() + 1 || text.charAt(qualifiedName.length() + 1) == '(');
|
||||
// text is like '@<qualified_name>[(parameters)]'
|
||||
if (!text.startsWith(qualifiedName, 1)) return false;
|
||||
int endOfQualifiedName = qualifiedName.length() + 1;
|
||||
return text.length() == endOfQualifiedName || text.charAt(endOfQualifiedName) == '(';
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user