mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add missing @NotNull annotations on arguments of PyFile#find* methods
This commit is contained in:
@@ -35,13 +35,13 @@ public interface PyFile extends PyElement, PsiFile, PyDocStringOwner, ScopeOwner
|
||||
List<PyTargetExpression> getTopLevelAttributes();
|
||||
|
||||
@Nullable
|
||||
PyFunction findTopLevelFunction(String name);
|
||||
PyFunction findTopLevelFunction(@NotNull String name);
|
||||
|
||||
@Nullable
|
||||
PyClass findTopLevelClass(String name);
|
||||
PyClass findTopLevelClass(@NotNull String name);
|
||||
|
||||
@Nullable
|
||||
PyTargetExpression findTopLevelAttribute(String name);
|
||||
PyTargetExpression findTopLevelAttribute(@NotNull String name);
|
||||
|
||||
LanguageLevel getLanguageLevel();
|
||||
|
||||
|
||||
@@ -215,22 +215,22 @@ public class PyFileImpl extends PsiFileBase implements PyFile, PyExpression {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PyFunction findTopLevelFunction(String name) {
|
||||
public PyFunction findTopLevelFunction(@NotNull String name) {
|
||||
return findByName(name, getTopLevelFunctions());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PyClass findTopLevelClass(String name) {
|
||||
public PyClass findTopLevelClass(@NotNull String name) {
|
||||
return findByName(name, getTopLevelClasses());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PyTargetExpression findTopLevelAttribute(String name) {
|
||||
public PyTargetExpression findTopLevelAttribute(@NotNull String name) {
|
||||
return findByName(name, getTopLevelAttributes());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static <T extends PsiNamedElement> T findByName(String name, List<T> namedElements) {
|
||||
private static <T extends PsiNamedElement> T findByName(@NotNull String name, @NotNull List<T> namedElements) {
|
||||
for (T namedElement : namedElements) {
|
||||
if (name.equals(namedElement.getName())) {
|
||||
return namedElement;
|
||||
|
||||
Reference in New Issue
Block a user