Examples of SourceEntry


Examples of com.google.dart.engine.internal.cache.SourceEntry

          sources.add(source);
          return;
        }
      }
      for (Source librarySource : getLibrariesContaining(source)) {
        SourceEntry libraryEntry = cache.get(librarySource);
        if (libraryEntry instanceof DartEntry) {
          CacheState elementState = libraryEntry.getState(DartEntry.ELEMENT);
          if (elementState == CacheState.INVALID
              || (isPriority && elementState == CacheState.FLUSHED)) {
            sources.add(source);
            return;
          }
          CacheState resolvedUnitState = dartEntry.getStateInLibrary(
              DartEntry.RESOLVED_UNIT,
              librarySource);
          if (resolvedUnitState == CacheState.INVALID
              || (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
            LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
            if (libraryElement != null) {
              sources.add(source);
              return;
            }
          }
          if (generateSdkErrors || !source.isInSystemLibrary()) {
            CacheState verificationErrorsState = dartEntry.getStateInLibrary(
                DartEntry.VERIFICATION_ERRORS,
                librarySource);
            if (verificationErrorsState == CacheState.INVALID
                || (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
              LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
              if (libraryElement != null) {
                sources.add(source);
                return;
              }
            }
            if (hintsEnabled) {
              CacheState hintsState = dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
              if (hintsState == CacheState.INVALID
                  || (isPriority && hintsState == CacheState.FLUSHED)) {
                LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
                if (libraryElement != null) {
                  sources.add(source);
                  return;
                }
              }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

  private void invalidateAllLocalResolutionInformation(boolean invalidateUris) {
    HashMap<Source, Source[]> oldPartMap = new HashMap<Source, Source[]>();
    MapIterator<Source, SourceEntry> iterator = privatePartition.iterator();
    while (iterator.moveNext()) {
      Source source = iterator.getKey();
      SourceEntry sourceEntry = iterator.getValue();
      if (sourceEntry instanceof HtmlEntry) {
        HtmlEntryImpl htmlCopy = ((HtmlEntry) sourceEntry).getWritableCopy();
        htmlCopy.invalidateAllResolutionInformation(invalidateUris);
        iterator.setValue(htmlCopy);
        workManager.add(source, SourcePriority.HTML);
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

      DartEntryImpl libraryCopy = libraryEntry.getWritableCopy();
      libraryCopy.invalidateAllResolutionInformation(false);
      cache.put(librarySource, libraryCopy);
      workManager.add(librarySource, SourcePriority.LIBRARY);
      for (Source partSource : includedParts) {
        SourceEntry partEntry = cache.get(partSource);
        if (partEntry instanceof DartEntry) {
          DartEntryImpl partCopy = ((DartEntry) partEntry).getWritableCopy();
          partCopy.invalidateAllResolutionInformation(false);
          cache.put(partSource, partCopy);
        }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    Source source = task.getSource();
    Source librarySource = task.getLibraryElement().getSource();
    AnalysisException thrownException = task.getException();
    DartEntry dartEntry = null;
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        throw new ObsoleteSourceAnalysisException(source);
      } else if (!(sourceEntry instanceof DartEntry)) {
        // This shouldn't be possible because we should never have performed the task if the source
        // didn't represent a Dart file, but check to be safe.
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    HashMap<Source, TimestampedData<AnalysisError[]>> hintMap = task.getHintMap();
    if (hintMap == null) {
      synchronized (cacheLock) {
        // We don't have any information about which sources to mark as invalid other than the library
        // source.
        SourceEntry sourceEntry = cache.get(librarySource);
        if (sourceEntry == null) {
          throw new ObsoleteSourceAnalysisException(librarySource);
        } else if (!(sourceEntry instanceof DartEntry)) {
          // This shouldn't be possible because we should never have performed the task if the source
          // didn't represent a Dart file, but check to be safe.
          throw new AnalysisException(
              "Internal error: attempting to generate hints for non-Dart file as a Dart file: "
                  + librarySource.getFullName());
        }
        if (thrownException == null) {
          thrownException = new AnalysisException(
              "GenerateDartHintsTask returned a null hint map without throwing an exception: "
                  + librarySource.getFullName());
        }
        DartEntryImpl dartCopy = ((DartEntry) sourceEntry).getWritableCopy();
        dartCopy.recordHintErrorInLibrary(librarySource, thrownException);
        cache.put(librarySource, dartCopy);
      }
      throw thrownException;
    }
    for (Map.Entry<Source, TimestampedData<AnalysisError[]>> entry : hintMap.entrySet()) {
      Source unitSource = entry.getKey();
      TimestampedData<AnalysisError[]> results = entry.getValue();
      synchronized (cacheLock) {
        SourceEntry sourceEntry = cache.get(unitSource);
        if (!(sourceEntry instanceof DartEntry)) {
          // This shouldn't be possible because we should never have performed the task if the source
          // didn't represent a Dart file, but check to be safe.
          throw new AnalysisException(
              "Internal error: attempting to parse non-Dart file as a Dart file: "
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    if (!task.isComplete()) {
      return null;
    }
    Source source = task.getSource();
    AnalysisException thrownException = task.getException();
    SourceEntry sourceEntry = null;
    synchronized (cacheLock) {
      sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        throw new ObsoleteSourceAnalysisException(source);
      }
      SourceEntryImpl sourceCopy = sourceEntry.getWritableCopy();
      if (thrownException == null) {
        sourceCopy.setModificationTime(task.getModificationTime());
        sourceCopy.setValue(SourceEntry.CONTENT, task.getContent());
      } else {
        sourceCopy.recordContentError(thrownException);
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

  private DartEntry recordParseDartTaskResults(ParseDartTask task) throws AnalysisException {
    Source source = task.getSource();
    AnalysisException thrownException = task.getException();
    DartEntry dartEntry = null;
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        throw new ObsoleteSourceAnalysisException(source);
      } else if (!(sourceEntry instanceof DartEntry)) {
        // This shouldn't be possible because we should never have performed the task if the source
        // didn't represent a Dart file, but check to be safe.
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

  private HtmlEntry recordParseHtmlTaskResults(ParseHtmlTask task) throws AnalysisException {
    Source source = task.getSource();
    AnalysisException thrownException = task.getException();
    HtmlEntry htmlEntry = null;
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        throw new ObsoleteSourceAnalysisException(source);
      } else if (!(sourceEntry instanceof HtmlEntry)) {
        // This shouldn't be possible because we should never have performed the task if the source
        // didn't represent an HTML file, but check to be safe.
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

      throws AnalysisException {
    Source source = task.getSource();
    AnalysisException thrownException = task.getException();
    HtmlEntry htmlEntry = null;
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        throw new ObsoleteSourceAnalysisException(source);
      } else if (!(sourceEntry instanceof HtmlEntry)) {
        // This shouldn't be possible because we should never have performed the task if the source
        // didn't represent an HTML file, but check to be safe.
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

      throws AnalysisException {
    Source source = task.getSource();
    AnalysisException thrownException = task.getException();
    HtmlEntry htmlEntry = null;
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        throw new ObsoleteSourceAnalysisException(source);
      } else if (!(sourceEntry instanceof HtmlEntry)) {
        // This shouldn't be possible because we should never have performed the task if the source
        // didn't represent an HTML file, but check to be safe.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.