/** * Given a list of fragment roots, returns the subset of roots that have changed since the last time they were * indexed. */ private List<IPath> getIndexablesThatHaveChanged(Collection<IPath> indexables, Map<IPath, FingerprintTestResult> fingerprints) { List<IPath> indexablesWithChanges = new ArrayList<>(); for (IPath next : indexables) { FingerprintTestResult testResult = fingerprints.get(next); if (!testResult.matches()) { indexablesWithChanges.add(next); } } return indexablesWithChanges; }
/** * Given a list of fragment roots, returns the subset of roots that have changed since the last time they were * indexed. */ private List<IPath> getIndexablesThatHaveChanged(Collection<IPath> indexables, Map<IPath, FingerprintTestResult> fingerprints) { List<IPath> indexablesWithChanges = new ArrayList<>(); for (IPath next : indexables) { FingerprintTestResult testResult = fingerprints.get(next); if (!testResult.matches()) { indexablesWithChanges.add(next); } } return indexablesWithChanges; }
/** * Returns true iff the given resource file is up-to-date with the filesystem. Returns false * if the argument is null or there is a possibility it being out-of-date with the file system. * * @param file the index file to look up or null * @throws CoreException */ public boolean isUpToDate(NdResourceFile file) throws CoreException { if (file != null && file.isDoneIndexing()) { String location = file.getLocation().getString(); FileStateCache cache = FileStateCache.getCache(getNd()); Boolean cachedResult = cache.isUpToDate(location); if (cachedResult != null) { return cachedResult; } Path locationPath = new Path(location); boolean result = file.getFingerprint().test(locationPath, null).matches(); cache.put(location, result); return result; } return false; }
if (resourceFile != null && result.matches() && result.needsNewFingerprint()) { this.nd.acquireWriteLock(subMonitor.split(10)); try {
if (resourceFile != null && result.matches() && result.needsNewFingerprint()) { this.nd.acquireWriteLock(subMonitor.split(10)); try {
/** * Returns true iff the given resource file is up-to-date with the filesystem. Returns false * if the argument is null or there is a possibility it being out-of-date with the file system. * * @param file the index file to look up or null * @throws CoreException */ public boolean isUpToDate(NdResourceFile file) throws CoreException { if (file != null && file.isDoneIndexing()) { String location = file.getLocation().getString(); FileStateCache cache = FileStateCache.getCache(getNd()); Boolean cachedResult = cache.isUpToDate(location); if (cachedResult != null) { return cachedResult; } Path locationPath = new Path(location); boolean result = file.getFingerprint().test(locationPath, null).matches(); cache.put(location, result); return result; } return false; }