diamond operator

This commit is contained in:
Olivier Lamy 2014-04-16 17:12:51 +10:00
parent 1e2bb57406
commit 67985e0486
2 changed files with 7 additions and 3 deletions

View File

@ -161,7 +161,7 @@ public class DefaultBrowseService
{
List<String> selectedRepos = getSelectedRepos( repositoryId );
Set<String> projects = new LinkedHashSet<String>();
Set<String> projects = new LinkedHashSet<>();
RepositorySession repositorySession = repositorySessionFactory.createSession();
Set<String> namespaces;
@ -169,7 +169,7 @@ public class DefaultBrowseService
{
MetadataResolver metadataResolver = repositorySession.getResolver();
Set<String> namespacesToCollapse = new LinkedHashSet<String>();
Set<String> namespacesToCollapse = new LinkedHashSet<>();
for ( String repoId : selectedRepos )
{
namespacesToCollapse.addAll( metadataResolver.resolveNamespaces( repositorySession, repoId, groupId ) );
@ -180,7 +180,7 @@ public class DefaultBrowseService
// TODO: this logic should be optional, particularly remembering we want to keep this code simple
// it is located here to avoid the content repository implementation needing to do too much for what
// is essentially presentation code
namespaces = new LinkedHashSet<String>();
namespaces = new LinkedHashSet<>();
for ( String n : namespacesToCollapse )
{
// TODO: check performance of this

View File

@ -87,6 +87,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@ -571,6 +572,9 @@ public class Maven2RepositoryStorage
// scan all directories in the namespace, and only include those that are known to be projects
List<String> projects = new ArrayList<>();
File[] files = dir.listFiles( new DirectoryFilter( filter ) );
if ( files != null )
{