diff options
author | Jon Bratseth <bratseth@oath.com> | 2020-02-02 20:48:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-02 20:48:06 +0100 |
commit | 3e21ae3340cb49c0b28e8646e3eb1ae22d6241cc (patch) | |
tree | 2051e781b2a94083341681d74bbb5fa4a7e3a51e /container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java | |
parent | 99f3a7193090cfcd6b5fdbbe612f53d892f9d86b (diff) | |
parent | 2d9e0965bd2fb10cbf5ffd47fa55a98aea5710b3 (diff) |
Merge pull request #12035 from vespa-engine/revert-12025-bratseth/anonymous-query-profile-types
Revert "Allow extension of implicitly ref'ed query profile types"
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java b/container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java index 1b1cdce5890..33f07a58195 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java @@ -33,7 +33,7 @@ public class QueryProfileXMLReader { * Reads all query profile xml files in a given directory, * and all type xml files from the immediate subdirectory "types/" (if any) * - * @throws IllegalArgumentException if the directory is not readable, or if there is some error in the XML + * @throws RuntimeException if <code>directory</code> is not a readable directory, or if there is some error in the XML */ public QueryProfileRegistry read(String directory) { List<NamedReader> queryProfileReaders = new ArrayList<>(); @@ -58,7 +58,7 @@ public class QueryProfileXMLReader { return read(queryProfileTypeReaders,queryProfileReaders); } catch (IOException e) { - throw new IllegalArgumentException("Could not read query profiles from '" + directory + "'", e); + throw new IllegalArgumentException("Could not read query profiles from '" + directory + "'",e); } finally { closeAll(queryProfileReaders); @@ -105,14 +105,14 @@ public class QueryProfileXMLReader { "' must be 'query-profile-type', not '" + root.getNodeName() + "'"); } - String idString = root.getAttribute("id"); + String idString=root.getAttribute("id"); if (idString == null || idString.equals("")) throw new IllegalArgumentException("'" + reader.getName() + "' has no 'id' attribute in the root element"); ComponentId id = new ComponentId(idString); - validateFileNameToId(reader.getName(), id,"query profile type"); + validateFileNameToId(reader.getName(),id,"query profile type"); QueryProfileType type = new QueryProfileType(id); - type.setMatchAsPath(XML.getChild(root, "match") != null); - type.setStrict(XML.getChild(root, "strict") != null); + type.setMatchAsPath(XML.getChild(root,"match") != null); + type.setStrict(XML.getChild(root,"strict") != null); registry.register(type); queryProfileTypeElements.add(root); } @@ -145,7 +145,7 @@ public class QueryProfileXMLReader { queryProfile.setType(type); } - Element dimensions = XML.getChild(root, "dimensions"); + Element dimensions = XML.getChild(root,"dimensions"); if (dimensions != null) queryProfile.setDimensions(toArray(XML.getValue(dimensions))); @@ -215,7 +215,7 @@ public class QueryProfileXMLReader { try { String fieldTypeName = field.getAttribute("type"); if (fieldTypeName == null) throw new IllegalArgumentException("Field '" + field + "' has no 'type' attribute"); - FieldType fieldType = FieldType.fromString(fieldTypeName, registry); + FieldType fieldType=FieldType.fromString(fieldTypeName,registry); type.addField(new FieldDescription(name, fieldType, field.getAttribute("alias"), |