diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-02-04 07:41:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 07:41:31 +0100 |
commit | 72cd1c70fdbe01968ef5a6ed6e05f5fa0ba4d319 (patch) | |
tree | 1552b25d1eb0233bfb1cdc8c36adf8190302af52 /container-search/src/main/java/com/yahoo/search/query/profile/config | |
parent | 17e572d4dad3c9e5040544072dbdc9f7a703e7bd (diff) |
Revert "Bratseth/anonymous query profile types take 2"
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/config')
-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"), |