diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-03-07 09:59:15 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-03-07 09:59:15 +0000 |
commit | 597689db11bce4732a0055c3f05d9347fcb7b38b (patch) | |
tree | 18291240e5863744ebffc78803199f4700c8c465 /config-model | |
parent | dd5eb81dd5883bc77936b68611c8e6cddd416abc (diff) |
update language in warning, add TODO
Diffstat (limited to 'config-model')
3 files changed, 6 insertions, 5 deletions
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 e419b8c93a7..e7b7c92ca2f 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java @@ -745,8 +745,8 @@ public class RankProfile implements Cloneable { public RankingExpressionFunction addFunction(ExpressionFunction function, boolean inline) { RankingExpressionFunction rankingExpressionFunction = new RankingExpressionFunction(function, inline); if (functions.containsKey(function.getName())) { - deployLogger.log(Level.WARNING, "Function '" + function.getName() + "' replaces a previous function " + - "with the same name in rank profile '" + this.name + "'"); + deployLogger.log(Level.WARNING, "Function '" + function.getName() + "' is defined twice " + + "in rank profile '" + this.name + "'"); } functions.put(function.getName(), rankingExpressionFunction); allFunctionsCached = null; diff --git a/config-model/src/main/javacc/IntermediateParser.jj b/config-model/src/main/javacc/IntermediateParser.jj index 3f95bd02bce..b57719ec72d 100644 --- a/config-model/src/main/javacc/IntermediateParser.jj +++ b/config-model/src/main/javacc/IntermediateParser.jj @@ -1909,8 +1909,9 @@ void function(ParsedRankProfile profile) : func.setInline(inline); var old = profile.addOrReplaceFunction(func); if (old != null) { + /* TODO disallow this for Vespa 8 */ deployLogger.logApplicationPackage(Level.WARNING, "Function '" + func.name() - + "' replaces a previous function with the same name in rank profile '" + + "' is defined twice in rank profile '" + profile.name() + "'"); } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java index b671dc515c1..e297beef026 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/RankingExpressionInliningTestCase.java @@ -224,8 +224,8 @@ public class RankingExpressionInliningTestCase extends AbstractSchemaTestCase { Schema s = builder.getSchema(); RankProfile test = rankProfileRegistry.get(s, "test").compile(new QueryProfileRegistry(), new ImportedMlModels()); assertEquals("foo(2)", test.getFirstPhaseRanking().getRoot().toString()); - assertTrue("Does not contain expected warning", deployLogger.contains("Function 'foo' replaces " + - "a previous function with the same name in rank profile 'test'")); + assertTrue("Does not contain expected warning", + deployLogger.contains("Function 'foo' is defined twice in rank profile 'test'")); } /** |