mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-26 15:38:34 +00:00
Rename getDependentPaths() to getDependencyPaths() because the paths are
not dependent on the given CacheRecord - it is the other way round
This commit is contained in:
@@ -27,7 +27,7 @@ public interface CacheRecord {
|
||||
* @return a {@link Stream} of file (not directory) {@link Path}s whose modification or deletion causes invalidation
|
||||
* of this {@link CacheRecord}.
|
||||
*/
|
||||
Stream<Path> getDependentPaths();
|
||||
Stream<Path> getDependencyPaths();
|
||||
|
||||
/**
|
||||
* Callback called by the cache when this {@link CacheRecord} is removed from the cache.
|
||||
|
@@ -103,7 +103,7 @@ public class TimestampCacheFactory extends AbstractLogEnabled implements CacheFa
|
||||
* @return {@link Set} of {@link FileState}s at current time
|
||||
*/
|
||||
private Set<FileState> currentFileStates() {
|
||||
return record.getDependentPaths()
|
||||
return record.getDependencyPaths()
|
||||
.map(FileState::new)
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ public class WatchServiceCacheFactory extends AbstractLogEnabled implements Cach
|
||||
* @param record the {@link CacheRecord} to watch
|
||||
*/
|
||||
public void add(CacheRecord record) {
|
||||
record.getDependentPaths().forEach(p -> {
|
||||
record.getDependencyPaths().forEach(p -> {
|
||||
final List<CacheRecord> records = recordsByPath.computeIfAbsent(p, k -> new ArrayList<>());
|
||||
synchronized (records) {
|
||||
records.add(record);
|
||||
@@ -159,7 +159,7 @@ public class WatchServiceCacheFactory extends AbstractLogEnabled implements Cach
|
||||
void remove(List<CacheRecord> records) {
|
||||
for (CacheRecord record : records) {
|
||||
record.invalidate();
|
||||
record.getDependentPaths()
|
||||
record.getDependencyPaths()
|
||||
.map(Path::getParent)
|
||||
.forEach(dir -> registrationsByDir.compute(dir, this::unregister));
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ public class CliExtensionRealmCache extends DefaultExtensionRealmCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<Path> getDependentPaths() {
|
||||
public Stream<Path> getDependencyPaths() {
|
||||
return record.getArtifacts().stream().map(artifact -> artifact.getFile().toPath());
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ public class CliPluginArtifactsCache extends DefaultPluginArtifactsCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<Path> getDependentPaths() {
|
||||
public Stream<Path> getDependencyPaths() {
|
||||
return record.getArtifacts().stream().map(artifact -> artifact.getFile().toPath());
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@ public class CliPluginDescriptorCache extends DefaultPluginDescriptorCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<Path> getDependentPaths() {
|
||||
public Stream<Path> getDependencyPaths() {
|
||||
return Optional.ofNullable(descriptor.getArtifacts()).orElse(Collections.emptyList())
|
||||
.stream().map(artifact -> artifact.getFile().toPath());
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ public class CliPluginRealmCache extends DefaultPluginRealmCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<Path> getDependentPaths() {
|
||||
public Stream<Path> getDependencyPaths() {
|
||||
return record.getArtifacts().stream().map(artifact -> artifact.getFile().toPath());
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@ public class CliProjectArtifactsCache extends DefaultProjectArtifactsCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<Path> getDependentPaths() {
|
||||
public Stream<Path> getDependencyPaths() {
|
||||
return record.getArtifacts().stream()
|
||||
.map(Artifact::getFile)
|
||||
.filter(Objects::nonNull)
|
||||
|
@@ -89,7 +89,7 @@ public class TimestampCacheFactoryTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<Path> getDependentPaths() {
|
||||
public Stream<Path> getDependencyPaths() {
|
||||
return paths.stream();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user