diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2018-02-22 16:20:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 16:20:48 +0100 |
commit | 1791ba9fc169c821bee826ed39d9a42ffa03def0 (patch) | |
tree | 4601457cb3cdf0cc2a4b84efc44668748edfd8f3 /config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java | |
parent | 7358ce6a49eedf51b3761a855921c58a5f813321 (diff) |
Revert "Revert "Bratseth/typecheck all 3""
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/RankProfileRegistry.java | 8 |
1 files changed, 2 insertions, 6 deletions
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<String> 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); |