Package com.google.dart.engine.internal.cache

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


      int count = entryPairs.size();
      ResolvableCompilationUnit[] units = new ResolvableCompilationUnit[count];
      for (int i = 0; i < count; i++) {
        SourceEntryPair entryPair = entryPairs.get(i);
        Source source = entryPair.source;
        DartEntryImpl dartCopy = entryPair.entry.getWritableCopy();
        units[i] = new ResolvableCompilationUnit(
            dartCopy.getModificationTime(),
            dartCopy.getResolvableCompilationUnit(),
            source);
        cache.put(source, dartCopy);
      }
      library.setResolvableCompilationUnits(units);
    }
View Full Code Here


    // Determine the cache resolved unit
    Source librarySource = null;
    CompilationUnit unit = null;
    if (sourceEntry instanceof DartEntryImpl) {
      DartEntryImpl dartEntry = (DartEntryImpl) sourceEntry;
      Source[] librarySources = dartEntry.getLibrariesContaining();
      if (librarySources.length == 1) {
        librarySource = librarySources[0];
        if (librarySource != null) {
          unit = dartEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
        }
      }
    }

    // Create a new cache if there is not an existing cache or the source is different
View Full Code Here

    Source[] oldParts = dartEntry.getValue(DartEntry.INCLUDED_PARTS);
    for (int i = 0; i < oldParts.length; i++) {
      Source partSource = oldParts[i];
      DartEntry partEntry = getReadableDartEntry(partSource);
      if (partEntry != null && partEntry != dartEntry) {
        DartEntryImpl partCopy = partEntry.getWritableCopy();
        partCopy.removeContainingLibrary(librarySource);
        if (partCopy.getContainingLibraries().size() == 0 && !exists(partSource)) {
          cache.remove(partSource);
        } else {
          cache.put(partSource, partCopy);
        }
      }
View Full Code Here

      for (int i = 0; i < oldParts.length; i++) {
        Source partSource = oldParts[i];
        if (!partSource.equals(librarySource)) {
          DartEntry partEntry = getReadableDartEntry(partSource);
          if (partEntry != null) {
            DartEntryImpl partCopy = partEntry.getWritableCopy();
            partCopy.removeContainingLibrary(librarySource);
            if (partCopy.getContainingLibraries().size() == 0 && !exists(partSource)) {
              cache.remove(partSource);
            } else {
              cache.put(partSource, partCopy);
            }
          }
View Full Code Here

      for (Source library : librariesToInvalidate) {
        invalidateLibraryResolution(library);
      }

      removeFromParts(source, ((DartEntry) cache.get(source)));
      DartEntryImpl dartCopy = ((DartEntry) cache.get(source)).getWritableCopy();
      dartCopy.setModificationTime(getModificationStamp(source));
      dartCopy.invalidateAllInformation();
      cache.put(source, dartCopy);
      cache.removedAst(source);
      workManager.add(source, SourcePriority.UNKNOWN);
    }
  }
View Full Code Here

        }
      }
      for (Source librarySource : libraries) {
        invalidateLibraryResolution(librarySource);
      }
      DartEntryImpl dartCopy = ((DartEntry) sourceEntry).getWritableCopy();
      dartCopy.recordContentError(new AnalysisException("This source was marked as being deleted"));
      cache.put(source, dartCopy);
    }
    workManager.remove(source);
    removeFromPriorityOrder(source);
  }
View Full Code Here

        // ASTs that need to be resolved.
        return createResolveDartLibraryTask(librarySource, libraryEntry);
      }
    }

    DartEntryImpl dartCopy = dartEntry.getWritableCopy();
    dartCopy.setStateInLibrary(DartEntry.HINTS, librarySource, CacheState.IN_PROCESS);
    cache.put(source, dartCopy);
    return new TaskData(new GenerateDartHintsTask(this, units, libraryElement), false);
  }
View Full Code Here

    if (dartEntry.getState(DartEntry.TOKEN_STREAM) != CacheState.VALID
        || dartEntry.getState(SourceEntry.LINE_INFO) != CacheState.VALID) {
      return createScanDartTask(source, dartEntry);
    }
    Token tokenStream = dartEntry.getValue(DartEntry.TOKEN_STREAM);
    DartEntryImpl dartCopy = dartEntry.getWritableCopy();
    dartCopy.setState(DartEntry.TOKEN_STREAM, CacheState.FLUSHED);
    dartCopy.setState(DartEntry.PARSE_ERRORS, CacheState.IN_PROCESS);
    cache.put(source, dartCopy);
    return new TaskData(new ParseDartTask(
        this,
        source,
        dartCopy.getModificationTime(),
        tokenStream,
        dartEntry.getValue(SourceEntry.LINE_INFO)), false);
  }
View Full Code Here

          this,
          source,
          source,
          builder.getLibrariesInCycle()), false);
    } catch (AnalysisException exception) {
      DartEntryImpl dartCopy = dartEntry.getWritableCopy();
      dartCopy.recordResolutionError(exception);
      cache.put(source, dartCopy);
      AnalysisEngine.getInstance().getLogger().logError(
          "Internal error trying to create a ResolveDartLibraryTask",
          exception);
    }
View Full Code Here

  private TaskData createScanDartTask(Source source, DartEntry dartEntry) {
    if (dartEntry.getState(SourceEntry.CONTENT) != CacheState.VALID) {
      return createGetContentTask(source, dartEntry);
    }
    CharSequence content = dartEntry.getValue(SourceEntry.CONTENT);
    DartEntryImpl dartCopy = dartEntry.getWritableCopy();
    dartCopy.setState(SourceEntry.CONTENT, CacheState.FLUSHED);
    dartCopy.setState(DartEntry.SCAN_ERRORS, CacheState.IN_PROCESS);
    cache.put(source, dartCopy);
    return new TaskData(
        new ScanDartTask(this, source, dartCopy.getModificationTime(), content),
        false);
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.internal.cache.DartEntryImpl

Copyright © 2018 www.massapicom. 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.