Merge pull request #1305 from maginatics/unneeded-function-example

Replace unneeded Function with imperative approach
This commit is contained in:
Adrian Cole 2013-02-05 11:32:06 -08:00
commit 49990d97e4
1 changed files with 6 additions and 9 deletions

View File

@ -191,15 +191,12 @@ public class LocalAsyncBlobStore extends BaseAsyncBlobStore {
contents = newTreeSet(filter(contents, new DelimiterFilter(prefix, delimiter)));
Iterables.<StorageMetadata> addAll(contents, transform(commonPrefixes,
new Function<String, StorageMetadata>() {
public StorageMetadata apply(String o) {
MutableStorageMetadata md = new MutableStorageMetadataImpl();
md.setType(StorageType.RELATIVE_PATH);
md.setName(o);
return md;
}
}));
for (String o : commonPrefixes) {
MutableStorageMetadata md = new MutableStorageMetadataImpl();
md.setType(StorageType.RELATIVE_PATH);
md.setName(o);
contents.add(md);
}
}
// trim metadata, if the response isn't supposed to be detailed.