From 1791ba9fc169c821bee826ed39d9a42ffa03def0 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Thu, 22 Feb 2018 16:20:48 +0100 Subject: Revert "Revert "Bratseth/typecheck all 3"" --- .../main/java/com/yahoo/searchdefinition/RankProfileRegistry.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java') diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java index a075b9d00fa..7b4d70d85b1 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java @@ -16,8 +16,7 @@ import java.util.Set; * Having both of these mappings consolidated here make it easier to remove dependencies on these mappings at * run time, since it is essentially only used when building rank profile config at deployment time. * - * TODO: Reconsider the difference between local and global maps. Right now, the local maps might better be - * served from a different class owned by SearchBuilder. + * TODO: Rank profiles should be stored under its owning Search instance. * * @author Ulf Lilleengen */ @@ -31,9 +30,6 @@ public class RankProfileRegistry { /* These rank profiles can be overridden: 'default' rank profile, as that is documented to work. And 'unranked'. */ static final Set overridableRankProfileNames = new HashSet<>(Arrays.asList("default", "unranked")); - public RankProfileRegistry() { - } - public static RankProfileRegistry createRankProfileRegistryWithBuiltinRankProfiles(Search search) { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); rankProfileRegistry.addRankProfile(new DefaultRankProfile(search, rankProfileRegistry)); @@ -47,7 +43,7 @@ public class RankProfileRegistry { * @param rankProfile the rank profile to add */ public void addRankProfile(RankProfile rankProfile) { - if (!rankProfiles.containsKey(rankProfile.getSearch())) { + if ( ! rankProfiles.containsKey(rankProfile.getSearch())) { rankProfiles.put(rankProfile.getSearch(), new LinkedHashMap<>()); } checkForDuplicateRankProfile(rankProfile); -- cgit v1.2.3