From 67985e0486f4c0d4fb65ca0859201d70e91703b5 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 16 Apr 2014 17:12:51 +1000 Subject: [PATCH] diamond operator --- .../apache/archiva/rest/services/DefaultBrowseService.java | 6 +++--- .../repository/storage/maven2/Maven2RepositoryStorage.java | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java index 93e36284d..c98b5f9d2 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java @@ -161,7 +161,7 @@ public class DefaultBrowseService { List selectedRepos = getSelectedRepos( repositoryId ); - Set projects = new LinkedHashSet(); + Set projects = new LinkedHashSet<>(); RepositorySession repositorySession = repositorySessionFactory.createSession(); Set namespaces; @@ -169,7 +169,7 @@ public class DefaultBrowseService { MetadataResolver metadataResolver = repositorySession.getResolver(); - Set namespacesToCollapse = new LinkedHashSet(); + Set 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(); + namespaces = new LinkedHashSet<>(); for ( String n : namespacesToCollapse ) { // TODO: check performance of this diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java index 4f795ebcc..c85518a42 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java @@ -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 projects = new ArrayList<>(); + + + File[] files = dir.listFiles( new DirectoryFilter( filter ) ); if ( files != null ) { -- 2.39.5