diff --git a/python/src/com/jetbrains/python/PyNames.java b/python/src/com/jetbrains/python/PyNames.java index ec858b21ee73..93aedc4c3fe3 100644 --- a/python/src/com/jetbrains/python/PyNames.java +++ b/python/src/com/jetbrains/python/PyNames.java @@ -2,8 +2,11 @@ package com.jetbrains.python; import com.google.common.collect.ImmutableSet; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; -import java.util.*; +import java.util.Collections; +import java.util.Map; +import java.util.TreeMap; import java.util.regex.Pattern; /** @@ -241,7 +244,7 @@ public class PyNames { * @param name what to check * @return true iff name is not reserved and is a well-formed identifier. */ - public static boolean isIdentifier(@NonNls String name) { + public static boolean isIdentifier(@NotNull @NonNls String name) { return ! isReserved(name) && IDENTIFIER_PATTERN.matcher(name).matches(); } diff --git a/python/src/com/jetbrains/python/psi/PyUtil.java b/python/src/com/jetbrains/python/psi/PyUtil.java index 0ba219a55b8d..42cf7ce1e303 100644 --- a/python/src/com/jetbrains/python/psi/PyUtil.java +++ b/python/src/com/jetbrains/python/psi/PyUtil.java @@ -664,7 +664,7 @@ public class PyUtil { return name.startsWith("__") && !name.endsWith("__"); } - public static boolean isPythonIdentifier(String name) { + public static boolean isPythonIdentifier(@NotNull String name) { return PyNames.isIdentifier(name); }