Skip to content

Commit

Permalink
Switch from anonymous inner classes to lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
emmileaf committed Aug 22, 2022
1 parent 798882d commit 99faaa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,10 @@ public void setPaths(Provider<Object> paths) {
// Convert Provider<Object> to Provider<List<ExtraDirectoryParameters>>
this.paths.set(
paths.map(
new Transformer<List<ExtraDirectoryParameters>, Object>() {
@Override
public List<ExtraDirectoryParameters> transform(Object obj) {
return project.files(paths).getFiles().stream()
obj ->
project.files(paths).getFiles().stream()
.map(file -> new ExtraDirectoryParameters(objects, project, file.toPath(), "/"))
.collect(Collectors.toList());
}
}));
.collect(Collectors.toList())));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,8 @@ public void setFrom(Object from) {
}

public void setFrom(Provider<Object> from) {
this.from.set(
// Convert Provider<Object> to Provider<Path>
from.map(
new Transformer<Path, Object>() {
@Override
public Path transform(Object obj) {
return project.file(obj).toPath();
}
}));
// Convert Provider<Object> to Provider<Path>
this.from.set(from.map(obj -> project.file(obj).toPath()));
}

@Override
Expand Down

0 comments on commit 99faaa0

Please sign in to comment.