Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartElementImpl.java

Issue 10960002: "No SDK, No Problem!" (take 2) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartElementImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartElementImpl.java (revision 12608)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartElementImpl.java (working copy)
@@ -27,6 +27,7 @@
import com.google.dart.tools.core.model.DartModelStatus;
import com.google.dart.tools.core.model.DartModelStatusConstants;
import com.google.dart.tools.core.model.DartProject;
+import com.google.dart.tools.core.model.DartSdkManager;
import com.google.dart.tools.core.model.Field;
import com.google.dart.tools.core.model.OpenableElement;
import com.google.dart.tools.core.model.ParentElement;
@@ -277,9 +278,11 @@
public <E extends DartElement> List<E> getChildrenOfType(Class<E> elementClass)
throws DartModelException {
List<E> children = new ArrayList<E>();
- for (DartElement child : getChildren()) {
- if (elementClass.isInstance(child)) {
- children.add((E) child);
+ if (DartSdkManager.getManager().hasSdk()) {
+ for (DartElement child : getChildren()) {
+ if (elementClass.isInstance(child)) {
+ children.add((E) child);
+ }
}
}
return children;

Powered by Google App Engine
This is Rietveld 408576698