PY-18695 Handle signatures of functions with no arguments
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Wed, 9 Mar 2016 14:52:43 +0000 (17:52 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Thu, 10 Mar 2016 09:39:48 +0000 (12:39 +0300)
python/src/com/jetbrains/python/debugger/PySignatureCacheManagerImpl.java

index ac367f1de2cbebe8570b2e403505f98cd5996270..456b42f65c54bffd58daa5be817498fef2f8fc53 100644 (file)
@@ -249,7 +249,11 @@ public class PySignatureCacheManagerImpl extends PySignatureCacheManager {
     if (parts.length > 0) {
       PySignature signature = new PySignature(path, parts[0]);
       for (int i = 1; i < parts.length; i++) {
-        String[] var = parts[i].split(":");
+        String part = parts[i];
+        if (part.isEmpty()) {
+          continue;
+        }
+        String[] var = part.split(":");
         if (var.length == 2) {
           if (RETURN_TYPE.equals(var[0])) {
             signature = signature.addReturnType(var[1]);
@@ -260,7 +264,7 @@ public class PySignatureCacheManagerImpl extends PySignatureCacheManager {
         }
         else {
           throw new IllegalStateException(
-            "Should be <name>:<type> format for arg or " + RETURN_TYPE + ":<type> for return type; '" + parts[i] + "' instead.");
+            "Should be <name>:<type> format for arg or " + RETURN_TYPE + ":<type> for return type; '" + part + "' instead.");
         }
       }
       return signature;