From fa5f599c6ce501a6af11d527292a5f7c982fa1c3 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 7 Sep 2021 21:40:28 +0200 Subject: It is too early to check inheritance during parsing. We must wait until all serach and rank-profiles are properly parsed, --- .../src/main/java/com/yahoo/searchdefinition/RankProfile.java | 9 --------- .../java/com/yahoo/searchdefinition/RankProfileTestCase.java | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'config-model') diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java index 19933222587..4c4cc3b524f 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java @@ -195,15 +195,6 @@ public class RankProfile implements Cloneable { * definition */ public void setInherited(String inheritedName) { - if (inheritedName.equals(getName())) { - String msg = "Rank profile '" + getName() + "' inherits self, which is illegal."; - if (search.getDeployProperties().featureFlags().enforceRankProfileInheritance()) { - throw new IllegalArgumentException(msg); - } else { - log.warning(msg); - } - inheritedName = null; - } this.inheritedName = inheritedName; } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java index a728acf29e7..c58a539abf1 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankProfileTestCase.java @@ -92,7 +92,7 @@ public class RankProfileTestCase extends SchemaTestCase { builder.build(true); fail(); } catch (IllegalArgumentException e) { - assertEquals("Rank profile 'self' inherits self, which is illegal.", e.getMessage()); + assertEquals("There is a cycle in the inheritance for rank-profile 'self' = [self, self]", e.getMessage()); } } -- cgit v1.2.3