do not fail on qualifier resolve fail - it may succeed during evaluation appcode/142.2615 clion/142.2614
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Fri, 19 Jun 2015 18:13:56 +0000 (21:13 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Fri, 19 Jun 2015 18:13:56 +0000 (21:13 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/FieldEvaluator.java

index 8779d9f94b91b71bca22b8a4a4dbe6b5928f7a02..cab3811be6876c3ac9c5674df658a5e3f60116ac 100644 (file)
@@ -720,17 +720,12 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
             myResult = new FieldEvaluator(new TypeEvaluator(typeName), FieldEvaluator.createClassFilter(psiClass), name);
           }
           else {
-            PsiType type = qualifier.getType();
-            if(type == null) {
-              throwEvaluateException(DebuggerBundle.message("evaluation.error.qualifier.type.unknown", qualifier.getText()));
-            }
-
             qualifier.accept(this);
             if (myResult == null) {
               throwEvaluateException(DebuggerBundle.message("evaluation.error.cannot.evaluate.qualifier", qualifier.getText()));
             }
 
-            myResult = new FieldEvaluator(myResult, FieldEvaluator.createClassFilter(type), name);
+            myResult = new FieldEvaluator(myResult, FieldEvaluator.createClassFilter(qualifier.getType()), name);
           }
         }
         else {
index 4e35754b52e6354942ef5aa4f0d22345be9decae..719b2a3cbab875b2ef2d2ae8e7f84fdb8e58e6b3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ import com.intellij.psi.PsiType;
 import com.intellij.psi.util.PsiUtil;
 import com.sun.jdi.*;
 import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 public class FieldEvaluator implements Evaluator {
@@ -60,8 +61,9 @@ public class FieldEvaluator implements Evaluator {
     myTargetClassFilter = filter;
   }
 
-  public static TargetClassFilter createClassFilter(PsiType psiType) {
-    if(psiType instanceof PsiArrayType) {
+  @NotNull
+  public static TargetClassFilter createClassFilter(@Nullable PsiType psiType) {
+    if(psiType == null || psiType instanceof PsiArrayType) {
       return TargetClassFilter.ALL;
     }
     PsiClass psiClass = PsiUtil.resolveClassInType(psiType);