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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/cache/DartEntryImpl.java

Issue 17277004: Split list of referenced libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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.engine/src/com/google/dart/engine/internal/cache/DartEntryImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/cache/DartEntryImpl.java (revision 24187)
+++ editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/cache/DartEntryImpl.java (working copy)
@@ -172,18 +172,28 @@
private Source[] includedParts = Source.EMPTY_ARRAY;
/**
- * The state of the cached list of referenced libraries.
+ * The state of the cached list of exported libraries.
*/
- private CacheState referencedLibrariesState = CacheState.INVALID;
+ private CacheState exportedLibrariesState = CacheState.INVALID;
/**
- * The list of libraries referenced (imported or exported) by the library, or an empty array if
- * the list is not currently cached. The list will be empty if the Dart file is a part rather than
- * a library.
+ * The list of libraries exported by the library, or an empty array if the list is not currently
+ * cached. The list will be empty if the Dart file is a part rather than a library.
*/
- private Source[] referencedLibraries = Source.EMPTY_ARRAY;
+ private Source[] exportedLibraries = Source.EMPTY_ARRAY;
/**
+ * The state of the cached list of imported libraries.
+ */
+ private CacheState importedLibrariesState = CacheState.INVALID;
+
+ /**
+ * The list of libraries imported by the library, or an empty array if the list is not currently
+ * cached. The list will be empty if the Dart file is a part rather than a library.
+ */
+ private Source[] importedLibraries = Source.EMPTY_ARRAY;
+
+ /**
* The information known as a result of resolving this compilation unit as part of the library
* that contains this unit. This field will never be {@code null}.
*/
@@ -290,6 +300,10 @@
public CacheState getState(DataDescriptor<?> descriptor) {
if (descriptor == ELEMENT) {
return elementState;
+ } else if (descriptor == EXPORTED_LIBRARIES) {
+ return exportedLibrariesState;
+ } else if (descriptor == IMPORTED_LIBRARIES) {
+ return importedLibrariesState;
} else if (descriptor == INCLUDED_PARTS) {
return includedPartsState;
} else if (descriptor == IS_CLIENT) {
@@ -302,8 +316,6 @@
return parsedUnitState;
} else if (descriptor == PUBLIC_NAMESPACE) {
return publicNamespaceState;
- } else if (descriptor == REFERENCED_LIBRARIES) {
- return referencedLibrariesState;
} else if (descriptor == SOURCE_KIND) {
return sourceKindState;
} else {
@@ -334,6 +346,10 @@
public <E> E getValue(DataDescriptor<E> descriptor) {
if (descriptor == ELEMENT) {
return (E) element;
+ } else if (descriptor == EXPORTED_LIBRARIES) {
+ return (E) exportedLibraries;
+ } else if (descriptor == IMPORTED_LIBRARIES) {
+ return (E) importedLibraries;
} else if (descriptor == INCLUDED_PARTS) {
return (E) includedParts;
} else if (descriptor == IS_CLIENT) {
@@ -346,8 +362,6 @@
return (E) parsedUnit;
} else if (descriptor == PUBLIC_NAMESPACE) {
return (E) publicNamespace;
- } else if (descriptor == REFERENCED_LIBRARIES) {
- return (E) referencedLibraries;
} else if (descriptor == SOURCE_KIND) {
return (E) sourceKind;
}
@@ -414,9 +428,12 @@
includedParts = Source.EMPTY_ARRAY;
includedPartsState = CacheState.INVALID;
- referencedLibraries = Source.EMPTY_ARRAY;
- referencedLibrariesState = CacheState.INVALID;
+ exportedLibraries = Source.EMPTY_ARRAY;
+ exportedLibrariesState = CacheState.INVALID;
+ importedLibraries = Source.EMPTY_ARRAY;
+ importedLibrariesState = CacheState.INVALID;
+
bitmask = 0;
clientServerState = CacheState.INVALID;
launchableState = CacheState.INVALID;
@@ -478,9 +495,12 @@
includedParts = Source.EMPTY_ARRAY;
includedPartsState = CacheState.ERROR;
- referencedLibraries = Source.EMPTY_ARRAY;
- referencedLibrariesState = CacheState.ERROR;
+ exportedLibraries = Source.EMPTY_ARRAY;
+ exportedLibrariesState = CacheState.ERROR;
+ importedLibraries = Source.EMPTY_ARRAY;
+ importedLibrariesState = CacheState.ERROR;
+
bitmask = 0;
clientServerState = CacheState.ERROR;
launchableState = CacheState.ERROR;
@@ -548,6 +568,12 @@
if (descriptor == ELEMENT) {
element = updatedValue(state, element, null);
elementState = state;
+ } else if (descriptor == EXPORTED_LIBRARIES) {
+ exportedLibraries = updatedValue(state, exportedLibraries, Source.EMPTY_ARRAY);
+ exportedLibrariesState = state;
+ } else if (descriptor == IMPORTED_LIBRARIES) {
+ importedLibraries = updatedValue(state, importedLibraries, Source.EMPTY_ARRAY);
+ importedLibrariesState = state;
} else if (descriptor == INCLUDED_PARTS) {
includedParts = updatedValue(state, includedParts, Source.EMPTY_ARRAY);
includedPartsState = state;
@@ -566,9 +592,6 @@
} else if (descriptor == PUBLIC_NAMESPACE) {
publicNamespace = updatedValue(state, publicNamespace, null);
publicNamespaceState = state;
- } else if (descriptor == REFERENCED_LIBRARIES) {
- referencedLibraries = updatedValue(state, referencedLibraries, Source.EMPTY_ARRAY);
- referencedLibrariesState = state;
} else if (descriptor == SOURCE_KIND) {
sourceKind = updatedValue(state, sourceKind, SourceKind.UNKNOWN);
sourceKindState = state;
@@ -607,6 +630,12 @@
if (descriptor == ELEMENT) {
element = (LibraryElement) value;
elementState = CacheState.VALID;
+ } else if (descriptor == EXPORTED_LIBRARIES) {
+ exportedLibraries = value == null ? Source.EMPTY_ARRAY : (Source[]) value;
+ exportedLibrariesState = CacheState.VALID;
+ } else if (descriptor == IMPORTED_LIBRARIES) {
+ importedLibraries = value == null ? Source.EMPTY_ARRAY : (Source[]) value;
+ importedLibrariesState = CacheState.VALID;
} else if (descriptor == INCLUDED_PARTS) {
includedParts = value == null ? Source.EMPTY_ARRAY : (Source[]) value;
includedPartsState = CacheState.VALID;
@@ -633,9 +662,6 @@
} else if (descriptor == PUBLIC_NAMESPACE) {
publicNamespace = (Namespace) value;
publicNamespaceState = CacheState.VALID;
- } else if (descriptor == REFERENCED_LIBRARIES) {
- referencedLibraries = value == null ? Source.EMPTY_ARRAY : (Source[]) value;
- referencedLibrariesState = CacheState.VALID;
} else if (descriptor == SOURCE_KIND) {
sourceKind = (SourceKind) value;
sourceKindState = CacheState.VALID;
@@ -676,8 +702,10 @@
parseErrors = other.parseErrors;
includedPartsState = other.includedPartsState;
includedParts = other.includedParts;
- referencedLibrariesState = other.referencedLibrariesState;
- referencedLibraries = other.referencedLibraries;
+ exportedLibrariesState = other.exportedLibrariesState;
+ exportedLibraries = other.exportedLibraries;
+ importedLibrariesState = other.importedLibrariesState;
+ importedLibraries = other.importedLibraries;
resolutionState.copyFrom(other.resolutionState);
elementState = other.elementState;
element = other.element;

Powered by Google App Engine
This is Rietveld 408576698