PY-11075 Class must implement all abstract methods: false negative for abstract decor...
authorEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Fri, 11 Oct 2013 10:20:41 +0000 (14:20 +0400)
committerEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Fri, 11 Oct 2013 10:20:41 +0000 (14:20 +0400)
python/src/com/jetbrains/python/inspections/PyAbstractClassInspection.java

index eabe00f7882c7762e2badfb0966ec8d772d63568..34c09a02b4bd3488fb5846ad8e999a56eac6d59c 100644 (file)
@@ -10,8 +10,10 @@ import com.jetbrains.python.PyNames;
 import com.jetbrains.python.codeInsight.override.PyOverrideImplementUtil;
 import com.jetbrains.python.inspections.quickfix.PyImplementMethodsQuickFix;
 import com.jetbrains.python.psi.PyClass;
+import com.jetbrains.python.psi.PyDecorator;
 import com.jetbrains.python.psi.PyDecoratorList;
 import com.jetbrains.python.psi.PyFunction;
+import com.jetbrains.python.psi.impl.PyQualifiedName;
 import org.jetbrains.annotations.Nls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -51,8 +53,12 @@ public class PyAbstractClassInspection extends PyInspection {
       for (PyFunction method : functions) {
         final PyDecoratorList list = method.getDecoratorList();
         if (list != null && node.findMethodByName(method.getName(), false) == null) {
-          if (list.findDecorator(PyNames.ABSTRACTMETHOD) != null || list.findDecorator(PyNames.ABSTRACTPROPERTY) != null) {
-            toBeImplemented.add(method);
+          for (PyDecorator decorator : list.getDecorators()) {
+            final PyQualifiedName qualifiedName = decorator.getQualifiedName();
+            if (qualifiedName != null && (PyNames.ABSTRACTMETHOD.equals(qualifiedName.getLastComponent()) || PyNames.ABSTRACTPROPERTY.equals(
+              qualifiedName.getLastComponent()))) {
+              toBeImplemented.add(method);
+            }
           }
         }
       }