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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java

Issue 459703002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/handle/ElementHandle.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
index 0064dab1f14ed11db86d8f09b5056c1858fb75ad..9a36fc1d10f0a7f76c6edeac2948a627d5ff25db 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
@@ -100,6 +100,7 @@ import com.google.dart.engine.utilities.collection.ListUtilities;
import com.google.dart.engine.utilities.collection.MapIterator;
import com.google.dart.engine.utilities.io.PrintStringWriter;
import com.google.dart.engine.utilities.source.LineInfo;
+import com.google.dart.engine.utilities.translation.DartExpressionBody;
import com.google.dart.engine.utilities.translation.DartOmit;
import java.io.File;
@@ -3713,12 +3714,9 @@ public class AnalysisContextImpl implements InternalAnalysisContext {
private TaskData getNextAnalysisTaskForSource(Source source, SourceEntry sourceEntry,
boolean isPriority, boolean hintsEnabled) {
// Refuse to generate tasks for html based files that are above 1500 KB
- if (sourceEntry instanceof HtmlEntryImpl && source instanceof FileBasedSource) {
+ if (isTooBigHtmlSourceEntry(source, sourceEntry)) {
// TODO (jwren) we still need to report an error of some kind back to the client.
- File file = ((FileBasedSource) source).getFile();
- if (file.length() > (1500 * 1024)) {
- return new TaskData(null, false);
- }
+ return new TaskData(null, false);
}
if (sourceEntry == null) {
return new TaskData(null, false);
@@ -4294,6 +4292,15 @@ public class AnalysisContextImpl implements InternalAnalysisContext {
return false;
}
+ @DartExpressionBody("false")
+ private boolean isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) {
+ if (sourceEntry instanceof HtmlEntryImpl && source instanceof FileBasedSource) {
+ File file = ((FileBasedSource) source).getFile();
+ return file.length() > 1500 * 1024;
+ }
+ return false;
+ }
+
/**
* Log the given debugging information.
*
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/handle/ElementHandle.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698