    public static LiteralRange<?> buildLiteralRange(ASTERNode node) {
        JavaRegexAnalyzer analyzer;
        try {
            analyzer = new JavaRegexAnalyzer(String.valueOf(JexlASTHelper.getLiteralValue(node)));

            LiteralRange<String> range = new LiteralRange<>(JexlASTHelper.getIdentifier(node), NodeOperand.AND);
            range.updateLower(analyzer.getLeadingOrTrailingLiteral(), true);
            range.updateUpper(analyzer.getLeadingOrTrailingLiteral() + Constants.MAX_UNICODE_STRING, true);
            return range;
        } catch (JavaRegexParseException | NoSuchElementException e) {
            throw new DatawaveFatalQueryException(e);
        }
    }

    public static LiteralRange<?> buildLiteralRange(ASTERNode node) {
        JavaRegexAnalyzer analyzer;
        try {
            analyzer = new JavaRegexAnalyzer(String.valueOf(JexlASTHelper.getLiteralValue(node)));

            LiteralRange<String> range = new LiteralRange<String>(JexlASTHelper.getIdentifier(node), NodeOperand.AND);
            range.updateLower(analyzer.getLeadingOrTrailingLiteral(), true);
            range.updateUpper(analyzer.getLeadingOrTrailingLiteral() + Constants.MAX_UNICODE_STRING, true);
            return range;
        } catch (JavaRegexParseException | NoSuchElementException e) {
            throw new DatawaveFatalQueryException(e);
        }
    }

Replace Generic With Diamond LiteralRange<String> with LiteralRange<> in method public buildLiteralRange(node ASTERNode) : LiteralRange<?> from class datawave.query.jexl.visitors.IteratorBuildingVisitor


    LiteralRange<?> buildLiteralRange(ASTNRNode node) {
        JavaRegexAnalyzer analyzer;
        try {
            analyzer = new JavaRegexAnalyzer(String.valueOf(JexlASTHelper.getLiteralValue(node)));

            LiteralRange<String> range = new LiteralRange<>(JexlASTHelper.getIdentifier(node), NodeOperand.AND);
            range.updateLower(analyzer.getLeadingOrTrailingLiteral(), true);
            range.updateUpper(analyzer.getLeadingOrTrailingLiteral() + Constants.MAX_UNICODE_STRING, true);

            return range;
        } catch (JavaRegexParseException | NoSuchElementException e) {
            throw new DatawaveFatalQueryException(e);
        }
    }

    LiteralRange<?> buildLiteralRange(ASTNRNode node) {
        JavaRegexAnalyzer analyzer;
        try {
            analyzer = new JavaRegexAnalyzer(String.valueOf(JexlASTHelper.getLiteralValue(node)));

            LiteralRange<String> range = new LiteralRange<String>(JexlASTHelper.getIdentifier(node), NodeOperand.AND);
            range.updateLower(analyzer.getLeadingOrTrailingLiteral(), true);
            range.updateUpper(analyzer.getLeadingOrTrailingLiteral() + Constants.MAX_UNICODE_STRING, true);

            return range;
        } catch (JavaRegexParseException | NoSuchElementException e) {
            throw new DatawaveFatalQueryException(e);
        }
    }

Replace Generic With Diamond LiteralRange<String> with LiteralRange<> in method package buildLiteralRange(node ASTNRNode) : LiteralRange<?> from class datawave.query.jexl.visitors.IteratorBuildingVisitor


    public IteratorBuildingVisitor setIvaratorSources(SourceFactory sourceFactory, int maxIvaratorSources) {
        this.ivaratorSources = new SourcePool(sourceFactory, maxIvaratorSources);
        this.ivaratorSource = new ThreadLocalPooledSource<>(ivaratorSources);
        return this;
    }

    public IteratorBuildingVisitor setIvaratorSources(SourceFactory sourceFactory, int maxIvaratorSources) {
        this.ivaratorSources = new SourcePool(sourceFactory, maxIvaratorSources);
        this.ivaratorSource = new ThreadLocalPooledSource<Key,Value>(ivaratorSources);
        return this;
    }

Replace Generic With Diamond ThreadLocalPooledSource<Key,Value> with ThreadLocalPooledSource<> in method public setIvaratorSources(sourceFactory SourceFactory, maxIvaratorSources int) : IteratorBuildingVisitor from class datawave.query.jexl.visitors.IteratorBuildingVisitor


    @Override
    public Object visit(ASTAndNode node, Object data) {
        // first recurse and create the copy
        node = (ASTAndNode) (super.visit(node, data));

        // if this and node itself is the exceeded value threshold, then abort
        if (ExceededValueThresholdMarkerJexlNode.instanceOf(node)) {
            return node;
        }

        // find all of the single field function nodes, and all of the exceeded value threshold range nodes and map by field name
        // place all other nodes into the children list
        Set<JexlNode> functionNodes = new HashSet<>();
        Multimap<String,JexlNode> functionNodesByField = HashMultimap.create();
        Multimap<String,JexlNode> exceededValueRangeNodes = HashMultimap.create();
        List<JexlNode> children = new ArrayList<>();
        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
            JexlNode child = node.jjtGetChild(i);
            if (isSingleFieldFunctionNode(child)) {
                functionNodes.add(child);
                for (String field : getFunctionFields(child)) {
                    functionNodesByField.put(field, child);
                }
            } else if (isExceededValueRangeNode(child)) {
                exceededValueRangeNodes.put(getRangeField(child), child);
            } else {
                children.add(child);
            }
        }

        // determine if we have any functions that can be combined with the execeeded value threshold ranges
        Set<String> fields = Sets.intersection(functionNodesByField.keySet(), exceededValueRangeNodes.keySet());
        if (fields.isEmpty()) {
            return node;
        } else {
            // we have a cross section, so for each of those fields, push the functions into the exceeded value threshold along side of the range
            ASTAndNode newNode = newInstanceOfType(node);
            newNode.image = node.image;
            for (String field : fields) {
                boolean copyFunction = exceededValueRangeNodes.get(field).size() > 1;
                for (JexlNode range : exceededValueRangeNodes.removeAll(field)) {
                    Collection<JexlNode> functions = functionNodesByField.get(field);
                    functionNodes.removeAll(functions);
                    if (copyFunction) {
                        functions = new HashSet<>();
                        for (JexlNode function : functionNodesByField.get(field)) {
                            functions.add(super.copy(function));
                        }
                    }
                    children.add(pushFunctionIntoExceededValueRange(functions, range));
                    functionNodes.removeAll(functions);
                }
            }

            // now add in the children that remain
            children.addAll(functionNodes);
            children.addAll(exceededValueRangeNodes.values());

            // and return the new and node with the new children
            return children(newNode, children.toArray(new JexlNode[children.size()]));
        }
    }

    @Override
    public Object visit(ASTAndNode node, Object data) {
        // first recurse and create the copy
        node = (ASTAndNode) (super.visit(node, data));

        // if this and node itself is the exceeded value threshold, then abort
        if (ExceededValueThresholdMarkerJexlNode.instanceOf(node)) {
            return node;
        }

        // find all of the single field function nodes, and all of the exceeded value threshold range nodes and map by field name
        // place all other nodes into the children list
        Set<JexlNode> functionNodes = new HashSet<>();
        Multimap<String,JexlNode> functionNodesByField = HashMultimap.create();
        Multimap<String,JexlNode> exceededValueRangeNodes = HashMultimap.create();
        List<JexlNode> children = new ArrayList<JexlNode>();
        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
            JexlNode child = node.jjtGetChild(i);
            if (isSingleFieldFunctionNode(child)) {
                functionNodes.add(child);
                for (String field : getFunctionFields(child)) {
                    functionNodesByField.put(field, child);
                }
            } else if (isExceededValueRangeNode(child)) {
                exceededValueRangeNodes.put(getRangeField(child), child);
            } else {
                children.add(child);
            }
        }

        // determine if we have any functions that can be combined with the execeeded value threshold ranges
        Set<String> fields = Sets.intersection(functionNodesByField.keySet(), exceededValueRangeNodes.keySet());
        if (fields.isEmpty()) {
            return node;
        } else {
            // we have a cross section, so for each of those fields, push the functions into the exceeded value threshold along side of the range
            ASTAndNode newNode = newInstanceOfType(node);
            newNode.image = node.image;
            for (String field : fields) {
                boolean copyFunction = exceededValueRangeNodes.get(field).size() > 1;
                for (JexlNode range : exceededValueRangeNodes.removeAll(field)) {
                    Collection<JexlNode> functions = functionNodesByField.get(field);
                    functionNodes.removeAll(functions);
                    if (copyFunction) {
                        functions = new HashSet<>();
                        for (JexlNode function : functionNodesByField.get(field)) {
                            functions.add(super.copy(function));
                        }
                    }
                    children.add(pushFunctionIntoExceededValueRange(functions, range));
                    functionNodes.removeAll(functions);
                }
            }

            // now add in the children that remain
            children.addAll(functionNodes);
            children.addAll(exceededValueRangeNodes.values());

            // and return the new and node with the new children
            return children(newNode, children.toArray(new JexlNode[children.size()]));
        }
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method public visit(node ASTAndNode, data Object) : Object from class datawave.query.jexl.visitors.PushFunctionsIntoExceededValueRanges


    private boolean isBoundedRange(ASTAndNode node) {
        List<JexlNode> otherNodes = new ArrayList<>();
        Map<LiteralRange<?>,List<JexlNode>> ranges = JexlASTHelper.getBoundedRangesIndexAgnostic(node, otherNodes, false);
        if (ranges.size() == 1 && otherNodes.isEmpty()) {
            return true;
        }
        return false;
    }

    private boolean isBoundedRange(ASTAndNode node) {
        List<JexlNode> otherNodes = new ArrayList<JexlNode>();
        Map<LiteralRange<?>,List<JexlNode>> ranges = JexlASTHelper.getBoundedRangesIndexAgnostic(node, otherNodes, false);
        if (ranges.size() == 1 && otherNodes.isEmpty()) {
            return true;
        }
        return false;
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method private isBoundedRange(node ASTAndNode) : boolean from class datawave.query.jexl.visitors.TreeFlatteningRebuildingVisitor


    public AtomValuesMatchFunction() {
        super("atom_values_match", new ArrayList<>());
    }

    public AtomValuesMatchFunction() {
        super("atom_values_match", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public AtomValuesMatchFunction() from class datawave.query.language.functions.jexl.AtomValuesMatchFunction


    public Chain() {
        super("chain", new ArrayList<>());
    }

    public Chain() {
        super("chain", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public Chain() from class datawave.query.language.functions.jexl.Chain


    private Map<String,Object> parseFields(String fieldMapStr) {

        Map<String,Object> fieldMap = new HashMap<>();

        String[] split1 = fieldMapStr.split(",");
        for (String s : split1) {
            String[] split2 = s.trim().split("=");
            String variableName = split2[0];
            Object variableValue = null;

            if (split2.length == 1) {
                variableValue = variableName;
            } else {
                String variableValueString = (String) split2[1];
                if (variableValueString.startsWith("[") && variableValueString.endsWith("]")) {
                    List<String> choiceList = new ArrayList<>();
                    String[] choices = variableValueString.split("|");
                    for (String c : choices) {
                        choiceList.add(c);
                    }
                    variableValue = choiceList;
                } else {
                    variableValue = variableValueString;
                }
            }
            fieldMap.put(variableName, variableValue);
        }
        return fieldMap;
    }

    private Map<String,Object> parseFields(String fieldMapStr) {

        Map<String,Object> fieldMap = new HashMap<>();

        String[] split1 = fieldMapStr.split(",");
        for (String s : split1) {
            String[] split2 = s.trim().split("=");
            String variableName = split2[0];
            Object variableValue = null;

            if (split2.length == 1) {
                variableValue = variableName;
            } else {
                String variableValueString = (String) split2[1];
                if (variableValueString.startsWith("[") && variableValueString.endsWith("]")) {
                    List<String> choiceList = new ArrayList<String>();
                    String[] choices = variableValueString.split("|");
                    for (String c : choices) {
                        choiceList.add(c);
                    }
                    variableValue = choiceList;
                } else {
                    variableValue = variableValueString;
                }
            }
            fieldMap.put(variableName, variableValue);
        }
        return fieldMap;
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method private parseFields(fieldMapStr String) : Map<String,Object> from class datawave.query.language.functions.jexl.Chain


    public Set<String> getProcessedQueries(Document d) {

        Set<String> querySet = new HashSet<>();
        Properties singleProperties = new Properties();
        Properties undefinedProperties = new Properties();
        Map<String,List<String>> multiValueMap = new LinkedHashMap<>();

        // cycle through variable to field mapping
        for (Map.Entry<String,Object> entry : fieldMap.entrySet()) {
            String k = entry.getKey();
            Object v = entry.getValue();

            String fieldName = null;
            if (v instanceof String) {
                // simple case
                fieldName = (String) v;
            } else {
                // list of field choices, take the first that we find
                List<String> choiceList = (List<String>) v;
                for (String s : choiceList) {
                    if (d.containsKey(s)) {
                        fieldName = s;
                        break;
                    }
                }
            }

            if (fieldName != null) {
                List<String> fieldValues = getValueFromDocument(d, fieldName);
                if (fieldValues.size() == 0) {
                    undefinedProperties.setProperty(k, "__UNDEFINED__");
                } else if (fieldValues.size() == 1) {
                    singleProperties.setProperty(k, fieldValues.get(0));
                } else if (fieldValues.size() > 1) {
                    multiValueMap.put(k, fieldValues);
                }
            }
        }

        // initialize indexes
        Map<String,Integer> index = new LinkedHashMap<>();
        Map<String,Integer> sizes = new LinkedHashMap<>();
        for (Map.Entry<String,List<String>> entry : multiValueMap.entrySet()) {
            index.put(entry.getKey(), 0);
            sizes.put(entry.getKey(), entry.getValue().size());
        }

        PropertyPlaceholderHelper pph = new PropertyPlaceholderHelper("${", "}");
        Properties p = new Properties();
        do {
            p.clear();
            p.putAll(singleProperties);
            for (Map.Entry<String,Integer> entry : index.entrySet()) {
                p.setProperty(entry.getKey(), multiValueMap.get(entry.getKey()).get(entry.getValue()));
            }
            String finalQuery = null;
            if (undefinedProperties.isEmpty()) {
                finalQuery = pph.replacePlaceholders(query, p);
            } else {
                p.putAll(undefinedProperties);
                finalQuery = pph.replacePlaceholders(query, p);
                finalQuery = fixQuery(finalQuery);
            }
            if (finalQuery != null) {
                querySet.add(finalQuery);
            }
        } while (incrementIndexes(index, sizes));

        return querySet;
    }

    public Set<String> getProcessedQueries(Document d) {

        Set<String> querySet = new HashSet<>();
        Properties singleProperties = new Properties();
        Properties undefinedProperties = new Properties();
        Map<String,List<String>> multiValueMap = new LinkedHashMap<String,List<String>>();

        // cycle through variable to field mapping
        for (Map.Entry<String,Object> entry : fieldMap.entrySet()) {
            String k = entry.getKey();
            Object v = entry.getValue();

            String fieldName = null;
            if (v instanceof String) {
                // simple case
                fieldName = (String) v;
            } else {
                // list of field choices, take the first that we find
                List<String> choiceList = (List<String>) v;
                for (String s : choiceList) {
                    if (d.containsKey(s)) {
                        fieldName = s;
                        break;
                    }
                }
            }

            if (fieldName != null) {
                List<String> fieldValues = getValueFromDocument(d, fieldName);
                if (fieldValues.size() == 0) {
                    undefinedProperties.setProperty(k, "__UNDEFINED__");
                } else if (fieldValues.size() == 1) {
                    singleProperties.setProperty(k, fieldValues.get(0));
                } else if (fieldValues.size() > 1) {
                    multiValueMap.put(k, fieldValues);
                }
            }
        }

        // initialize indexes
        Map<String,Integer> index = new LinkedHashMap<>();
        Map<String,Integer> sizes = new LinkedHashMap<>();
        for (Map.Entry<String,List<String>> entry : multiValueMap.entrySet()) {
            index.put(entry.getKey(), 0);
            sizes.put(entry.getKey(), entry.getValue().size());
        }

        PropertyPlaceholderHelper pph = new PropertyPlaceholderHelper("${", "}");
        Properties p = new Properties();
        do {
            p.clear();
            p.putAll(singleProperties);
            for (Map.Entry<String,Integer> entry : index.entrySet()) {
                p.setProperty(entry.getKey(), multiValueMap.get(entry.getKey()).get(entry.getValue()));
            }
            String finalQuery = null;
            if (undefinedProperties.isEmpty()) {
                finalQuery = pph.replacePlaceholders(query, p);
            } else {
                p.putAll(undefinedProperties);
                finalQuery = pph.replacePlaceholders(query, p);
                finalQuery = fixQuery(finalQuery);
            }
            if (finalQuery != null) {
                querySet.add(finalQuery);
            }
        } while (incrementIndexes(index, sizes));

        return querySet;
    }

Replace Generic With Diamond LinkedHashMap<String,List<String>> with LinkedHashMap<> in method public getProcessedQueries(d Document) : Set<String> from class datawave.query.language.functions.jexl.Chain


    public ChainStart() {
        super("chainstart", new ArrayList<>());
    }

    public ChainStart() {
        super("chainstart", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public ChainStart() from class datawave.query.language.functions.jexl.ChainStart


    public DateFunction() {
        super("date", new ArrayList<>());
    }

    public DateFunction() {
        super("date", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public DateFunction() from class datawave.query.language.functions.jexl.DateFunction


    public Exclude() {
        super("exclude", new ArrayList<>());
    }

    public Exclude() {
        super("exclude", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public Exclude() from class datawave.query.language.functions.jexl.Exclude


    public GeoFunction() {
        super("geo", new ArrayList<>());
    }

    public GeoFunction() {
        super("geo", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public GeoFunction() from class datawave.query.language.functions.jexl.GeoFunction


    public GetAllMatches() {
        super("get_all_matches", new ArrayList<>());
    }

    public GetAllMatches() {
        super("get_all_matches", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public GetAllMatches() from class datawave.query.language.functions.jexl.GetAllMatches


    public Include() {
        super("include", new ArrayList<>());
    }

    public Include() {
        super("include", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public Include() from class datawave.query.language.functions.jexl.Include


    public IsNotNull() {
        super("isnotnull", new ArrayList<>());
    }

    public IsNotNull() {
        super("isnotnull", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public IsNotNull() from class datawave.query.language.functions.jexl.IsNotNull


    public IsNull() {
        super("isnull", new ArrayList<>());
    }

    public IsNull() {
        super("isnull", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public IsNull() from class datawave.query.language.functions.jexl.IsNull


    public Jexl() {
        super("jexl", new ArrayList<>());
    }

    public Jexl() {
        super("jexl", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public Jexl() from class datawave.query.language.functions.jexl.Jexl


    public Loaded() {
        super("loaded", new ArrayList<>());
    }

    public Loaded() {
        super("loaded", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public Loaded() from class datawave.query.language.functions.jexl.Loaded


    public MatchesAtLeastCountOf() {
        super("matches_at_least_count_of", new ArrayList<>());
    }

    public MatchesAtLeastCountOf() {
        super("matches_at_least_count_of", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public MatchesAtLeastCountOf() from class datawave.query.language.functions.jexl.MatchesAtLeastCountOf


    public MatchesInGroupFunction() {
        super("matches_in_group", new ArrayList<>());
    }

    public MatchesInGroupFunction() {
        super("matches_in_group", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public MatchesInGroupFunction() from class datawave.query.language.functions.jexl.MatchesInGroupFunction


    public MatchesInGroupLeft() {
        super("matches_in_group_left", new ArrayList<>());
    }

    public MatchesInGroupLeft() {
        super("matches_in_group_left", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public MatchesInGroupLeft() from class datawave.query.language.functions.jexl.MatchesInGroupLeft


    public OccurrenceFunction() {
        super("occurrence", new ArrayList<>());
    }

    public OccurrenceFunction() {
        super("occurrence", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public OccurrenceFunction() from class datawave.query.language.functions.jexl.OccurrenceFunction


    public TimeFunction() {
        super("time_function", new ArrayList<>());
    }

    public TimeFunction() {
        super("time_function", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public TimeFunction() from class datawave.query.language.functions.jexl.TimeFunction


    public GetAllMatches() {
        super("getAllMatches", new ArrayList<>());
    }

    public GetAllMatches() {
        super("getAllMatches", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public GetAllMatches() from class datawave.query.language.functions.lucene.GetAllMatches


    public Occurrence() {
        super("occurrence", new ArrayList<>());
    }

    public Occurrence() {
        super("occurrence", new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public Occurrence() from class datawave.query.language.functions.lucene.Occurrence


    public Options() {
        super(QueryFunctions.OPTIONS_FUNCTION, new ArrayList<>());
    }

    public Options() {
        super(QueryFunctions.OPTIONS_FUNCTION, new ArrayList<String>());
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public Options() from class datawave.query.language.functions.lucene.Options


    private JexlBooleanNode() {
        super(new ArrayList<>());
    }

    private JexlBooleanNode() {
        super(new ArrayList<JexlNode>());
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method private JexlBooleanNode() from class datawave.query.language.parser.jexl.JexlBooleanNode


    public JexlBooleanNode(Type type) {
        super(new ArrayList<>());
        this.type = type;
    }

    public JexlBooleanNode(Type type) {
        super(new ArrayList<JexlNode>());
        this.type = type;
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method public JexlBooleanNode(type Type) from class datawave.query.language.parser.jexl.JexlBooleanNode


    private JexlFunctionNode() {
        super(new ArrayList<>());
    }

    private JexlFunctionNode() {
        super(new ArrayList<JexlNode>());
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method private JexlFunctionNode() from class datawave.query.language.parser.jexl.JexlFunctionNode


    public JexlFunctionNode(JexlQueryFunction function, List<String> parameterList, int depth, QueryNode parent) {
        super(new ArrayList<>());

        this.function = function;
        this.function.initialize(parameterList, depth, parent);
    }

    public JexlFunctionNode(JexlQueryFunction function, List<String> parameterList, int depth, QueryNode parent) {
        super(new ArrayList<JexlNode>());

        this.function = function;
        this.function.initialize(parameterList, depth, parent);
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method public JexlFunctionNode(function JexlQueryFunction, parameterList List<String>, depth int, parent QueryNode) from class datawave.query.language.parser.jexl.JexlFunctionNode


    private JexlGroupingNode() {
        super(new ArrayList<>());
    }

    private JexlGroupingNode() {
        super(new ArrayList<JexlNode>());
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method private JexlGroupingNode() from class datawave.query.language.parser.jexl.JexlGroupingNode


    public JexlPhraseNode(String field, List<String> wordList) {
        super(new ArrayList<>());
        this.field = field;
        this.wordList = wordList;
    }

    public JexlPhraseNode(String field, List<String> wordList) {
        super(new ArrayList<JexlNode>());
        this.field = field;
        this.wordList = wordList;
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method public JexlPhraseNode(field String, wordList List<String>) from class datawave.query.language.parser.jexl.JexlPhraseNode


    private JexlRangeNode() {
        super(new ArrayList<>());
        this.field = "";
        this.beginRange = "";
        this.endRange = "";
        this.lowerInclusive = true;
        this.upperInclusive = true;
    }

    private JexlRangeNode() {
        super(new ArrayList<JexlNode>());
        this.field = "";
        this.beginRange = "";
        this.endRange = "";
        this.lowerInclusive = true;
        this.upperInclusive = true;
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method private JexlRangeNode() from class datawave.query.language.parser.jexl.JexlRangeNode


    public JexlRangeNode(String field, String beginRange, String endRange, Boolean lowerInclusive, Boolean upperInclusive) {
        super(new ArrayList<>());
        this.field = field;
        this.beginRange = jexlEscapeSelector(beginRange);
        this.endRange = jexlEscapeSelector(endRange);
        this.lowerInclusive = lowerInclusive;
        this.upperInclusive = upperInclusive;
    }

    public JexlRangeNode(String field, String beginRange, String endRange, Boolean lowerInclusive, Boolean upperInclusive) {
        super(new ArrayList<JexlNode>());
        this.field = field;
        this.beginRange = jexlEscapeSelector(beginRange);
        this.endRange = jexlEscapeSelector(endRange);
        this.lowerInclusive = lowerInclusive;
        this.upperInclusive = upperInclusive;
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method public JexlRangeNode(field String, beginRange String, endRange String, lowerInclusive Boolean, upperInclusive Boolean) from class datawave.query.language.parser.jexl.JexlRangeNode


    private JexlSelectorNode() {
        super(new ArrayList<>());
    }

    private JexlSelectorNode() {
        super(new ArrayList<JexlNode>());
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method private JexlSelectorNode() from class datawave.query.language.parser.jexl.JexlSelectorNode


    public JexlSelectorNode(Type type, String field, String selector) {
        super(new ArrayList<>());
        this.type = type;
        this.field = field;
        this.selector = selector;
    }

    public JexlSelectorNode(Type type, String field, String selector) {
        super(new ArrayList<JexlNode>());
        this.type = type;
        this.field = field;
        this.selector = selector;
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method public JexlSelectorNode(type Type, field String, selector String) from class datawave.query.language.parser.jexl.JexlSelectorNode


    public JexlWithinNode(String field, List<String> wordList, Integer distance) {
        super(new ArrayList<>());
        this.field = field;
        this.wordList = wordList;
        this.distance = distance;
    }

    public JexlWithinNode(String field, List<String> wordList, Integer distance) {
        super(new ArrayList<JexlNode>());
        this.field = field;
        this.wordList = wordList;
        this.distance = distance;
    }

Replace Generic With Diamond ArrayList<JexlNode> with ArrayList<> in method public JexlWithinNode(field String, wordList List<String>, distance Integer) from class datawave.query.language.parser.jexl.JexlWithinNode


        public Multimap<String,String> getEventFieldsToDelete(T updatedQueryMetric, T storedQueryMetric) {

            HashMultimap<String,String> fields = HashMultimap.create();

            SimpleDateFormat sdf_date_time2 = new SimpleDateFormat("yyyyMMdd HHmmss");

            if (updatedQueryMetric.getElapsedTime() != storedQueryMetric.getElapsedTime()) {
                fields.put("ELAPSED_TIME", Long.toString(storedQueryMetric.getElapsedTime()));
            }

            if (storedQueryMetric.getLastUpdated() != null && updatedQueryMetric.getLastUpdated() != null) {
                String storedValue = sdf_date_time2.format(storedQueryMetric.getLastUpdated());
                String updatedValue = sdf_date_time2.format(updatedQueryMetric.getLastUpdated());
                if (updatedValue.equals(storedValue) == false) {
                    fields.put("LAST_UPDATED", storedValue);
                }
            }

            fields.put("NUM_UPDATES", Long.toString(storedQueryMetric.getNumUpdates()));

            if (!updatedQueryMetric.getLifecycle().equals(storedQueryMetric.getLifecycle())) {
                if (storedQueryMetric.getLifecycle() != null) {
                    fields.put("LIFECYCLE", storedQueryMetric.getLifecycle().toString());
                }
            }

            if (updatedQueryMetric.getNumPages() != storedQueryMetric.getNumPages()) {
                fields.put("NUM_PAGES", Long.toString(storedQueryMetric.getNumPages()));
            }

            if (updatedQueryMetric.getNumResults() != storedQueryMetric.getNumResults()) {
                fields.put("NUM_RESULTS", Long.toString(storedQueryMetric.getNumResults()));
            }

            if (updatedQueryMetric.getSetupTime() != storedQueryMetric.getSetupTime()) {
                fields.put("SETUP_TIME", Long.toString(storedQueryMetric.getSetupTime()));
            }

            if (updatedQueryMetric.getLoginTime() != storedQueryMetric.getLoginTime()) {
                fields.put("LOGIN_TIME", Long.toString(storedQueryMetric.getLoginTime()));
            }

            Map<Long,PageMetric> storedPageMetricMap = new HashMap<>();
            List<PageMetric> storedPageMetrics = storedQueryMetric.getPageTimes();
            if (storedPageMetrics != null) {
                for (PageMetric p : storedPageMetrics) {
                    storedPageMetricMap.put(p.getPageNumber(), p);
                }
            }

            List<PageMetric> updatedPageMetrics = updatedQueryMetric.getPageTimes();
            if (updatedPageMetrics != null) {
                for (PageMetric p : updatedPageMetrics) {
                    long pageNum = p.getPageNumber();
                    PageMetric storedPageMetric = storedPageMetricMap.get(pageNum);
                    if (storedPageMetric != null && storedPageMetric.equals(p) == false) {
                        fields.put("PAGE_METRICS." + pageNum,
                                        storedPageMetric.getPagesize() + "/" + storedPageMetric.getReturnTime() + "/" + storedPageMetric.getCallTime() + "/"
                                                        + storedPageMetric.getSerializationTime() + "/" + storedPageMetric.getBytesWritten() + "/"
                                                        + storedPageMetric.getPageRequested() + "/" + storedPageMetric.getPageReturned() + "/"
                                                        + storedPageMetric.getLoginTime());
                    }
                }
            }

            if (updatedQueryMetric.getCreateCallTime() != storedQueryMetric.getCreateCallTime()) {
                fields.put("CREATE_CALL_TIME", Long.toString(storedQueryMetric.getCreateCallTime()));
            }

            if (updatedQueryMetric.getSourceCount() != storedQueryMetric.getSourceCount()) {
                fields.put("SOURCE_COUNT", Long.toString(storedQueryMetric.getSourceCount()));
            }
            if (updatedQueryMetric.getNextCount() != storedQueryMetric.getNextCount()) {
                fields.put("NEXT_COUNT", Long.toString(storedQueryMetric.getNextCount()));
            }
            if (updatedQueryMetric.getSeekCount() != storedQueryMetric.getSeekCount()) {
                fields.put("SEEK_COUNT", Long.toString(storedQueryMetric.getSeekCount()));
            }
            if (updatedQueryMetric.getDocRanges() != storedQueryMetric.getDocRanges()) {
                fields.put("DOC_RANGES", Long.toString(storedQueryMetric.getDocRanges()));
            }
            if (updatedQueryMetric.getFiRanges() != storedQueryMetric.getFiRanges()) {
                fields.put("FI_RANGES", Long.toString(storedQueryMetric.getFiRanges()));
            }

            putExtendedFieldsToDelete(updatedQueryMetric, fields);

            return fields;
        }

        public Multimap<String,String> getEventFieldsToDelete(T updatedQueryMetric, T storedQueryMetric) {

            HashMultimap<String,String> fields = HashMultimap.create();

            SimpleDateFormat sdf_date_time2 = new SimpleDateFormat("yyyyMMdd HHmmss");

            if (updatedQueryMetric.getElapsedTime() != storedQueryMetric.getElapsedTime()) {
                fields.put("ELAPSED_TIME", Long.toString(storedQueryMetric.getElapsedTime()));
            }

            if (storedQueryMetric.getLastUpdated() != null && updatedQueryMetric.getLastUpdated() != null) {
                String storedValue = sdf_date_time2.format(storedQueryMetric.getLastUpdated());
                String updatedValue = sdf_date_time2.format(updatedQueryMetric.getLastUpdated());
                if (updatedValue.equals(storedValue) == false) {
                    fields.put("LAST_UPDATED", storedValue);
                }
            }

            fields.put("NUM_UPDATES", Long.toString(storedQueryMetric.getNumUpdates()));

            if (!updatedQueryMetric.getLifecycle().equals(storedQueryMetric.getLifecycle())) {
                if (storedQueryMetric.getLifecycle() != null) {
                    fields.put("LIFECYCLE", storedQueryMetric.getLifecycle().toString());
                }
            }

            if (updatedQueryMetric.getNumPages() != storedQueryMetric.getNumPages()) {
                fields.put("NUM_PAGES", Long.toString(storedQueryMetric.getNumPages()));
            }

            if (updatedQueryMetric.getNumResults() != storedQueryMetric.getNumResults()) {
                fields.put("NUM_RESULTS", Long.toString(storedQueryMetric.getNumResults()));
            }

            if (updatedQueryMetric.getSetupTime() != storedQueryMetric.getSetupTime()) {
                fields.put("SETUP_TIME", Long.toString(storedQueryMetric.getSetupTime()));
            }

            if (updatedQueryMetric.getLoginTime() != storedQueryMetric.getLoginTime()) {
                fields.put("LOGIN_TIME", Long.toString(storedQueryMetric.getLoginTime()));
            }

            Map<Long,PageMetric> storedPageMetricMap = new HashMap<Long,PageMetric>();
            List<PageMetric> storedPageMetrics = storedQueryMetric.getPageTimes();
            if (storedPageMetrics != null) {
                for (PageMetric p : storedPageMetrics) {
                    storedPageMetricMap.put(p.getPageNumber(), p);
                }
            }

            List<PageMetric> updatedPageMetrics = updatedQueryMetric.getPageTimes();
            if (updatedPageMetrics != null) {
                for (PageMetric p : updatedPageMetrics) {
                    long pageNum = p.getPageNumber();
                    PageMetric storedPageMetric = storedPageMetricMap.get(pageNum);
                    if (storedPageMetric != null && storedPageMetric.equals(p) == false) {
                        fields.put("PAGE_METRICS." + pageNum,
                                        storedPageMetric.getPagesize() + "/" + storedPageMetric.getReturnTime() + "/" + storedPageMetric.getCallTime() + "/"
                                                        + storedPageMetric.getSerializationTime() + "/" + storedPageMetric.getBytesWritten() + "/"
                                                        + storedPageMetric.getPageRequested() + "/" + storedPageMetric.getPageReturned() + "/"
                                                        + storedPageMetric.getLoginTime());
                    }
                }
            }

            if (updatedQueryMetric.getCreateCallTime() != storedQueryMetric.getCreateCallTime()) {
                fields.put("CREATE_CALL_TIME", Long.toString(storedQueryMetric.getCreateCallTime()));
            }

            if (updatedQueryMetric.getSourceCount() != storedQueryMetric.getSourceCount()) {
                fields.put("SOURCE_COUNT", Long.toString(storedQueryMetric.getSourceCount()));
            }
            if (updatedQueryMetric.getNextCount() != storedQueryMetric.getNextCount()) {
                fields.put("NEXT_COUNT", Long.toString(storedQueryMetric.getNextCount()));
            }
            if (updatedQueryMetric.getSeekCount() != storedQueryMetric.getSeekCount()) {
                fields.put("SEEK_COUNT", Long.toString(storedQueryMetric.getSeekCount()));
            }
            if (updatedQueryMetric.getDocRanges() != storedQueryMetric.getDocRanges()) {
                fields.put("DOC_RANGES", Long.toString(storedQueryMetric.getDocRanges()));
            }
            if (updatedQueryMetric.getFiRanges() != storedQueryMetric.getFiRanges()) {
                fields.put("FI_RANGES", Long.toString(storedQueryMetric.getFiRanges()));
            }

            putExtendedFieldsToDelete(updatedQueryMetric, fields);

            return fields;
        }

Replace Generic With Diamond HashMap<Long,PageMetric> with HashMap<> in method public getEventFieldsToDelete(updatedQueryMetric T, storedQueryMetric T) : Multimap<String,String> from class datawave.query.metrics.ContentQueryMetricsIngestHelper.HelperDelegate


    @PostConstruct
    private void initialize() {
        Connector connector = null;

        try {
            connector = connectionFactory.getConnection(Priority.ADMIN, new HashMap<>());
            connectorAuthorizations = connector.securityOperations().getUserAuthorizations(connector.whoami()).toString();
            connectorAuthorizationCollection = Lists.newArrayList(StringUtils.split(connectorAuthorizations, ","));
            reload();

            if (tablesChecked.compareAndSet(false, true))
                verifyTables();
        } catch (Exception e) {
            log.error("Error setting connection factory", e);
        } finally {
            if (connector != null) {
                try {
                    connectionFactory.returnConnection(connector);
                } catch (Exception e) {
                    log.error("Error returning connection to connection factory", e);
                }
            }
        }
    }

    @PostConstruct
    private void initialize() {
        Connector connector = null;

        try {
            connector = connectionFactory.getConnection(Priority.ADMIN, new HashMap<String,String>());
            connectorAuthorizations = connector.securityOperations().getUserAuthorizations(connector.whoami()).toString();
            connectorAuthorizationCollection = Lists.newArrayList(StringUtils.split(connectorAuthorizations, ","));
            reload();

            if (tablesChecked.compareAndSet(false, true))
                verifyTables();
        } catch (Exception e) {
            log.error("Error setting connection factory", e);
        } finally {
            if (connector != null) {
                try {
                    connectionFactory.returnConnection(connector);
                } catch (Exception e) {
                    log.error("Error returning connection to connection factory", e);
                }
            }
        }
    }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method private initialize() : void from class datawave.query.metrics.ShardTableQueryMetricHandler


    private void verifyTables() {
        Connector connector = null;

        try {
            connector = this.connectionFactory.getConnection(Priority.ADMIN, new HashMap<>());
            AbstractColumnBasedHandler<Key> handler = new ContentQueryMetricsHandler<>();
            createAndConfigureTablesIfNecessary(handler.getTableNames(conf), connector.tableOperations(), conf);
        } catch (Exception e) {
            log.error("Error verifying table configuration", e);
        } finally {
            if (null != connector) {
                try {
                    this.connectionFactory.returnConnection(connector);
                } catch (Exception e) {
                    log.error("Error returning connection to connection factory");
                }
            }
        }
    }

    private void verifyTables() {
        Connector connector = null;

        try {
            connector = this.connectionFactory.getConnection(Priority.ADMIN, new HashMap<String,String>());
            AbstractColumnBasedHandler<Key> handler = new ContentQueryMetricsHandler<>();
            createAndConfigureTablesIfNecessary(handler.getTableNames(conf), connector.tableOperations(), conf);
        } catch (Exception e) {
            log.error("Error verifying table configuration", e);
        } finally {
            if (null != connector) {
                try {
                    this.connectionFactory.returnConnection(connector);
                } catch (Exception e) {
                    log.error("Error returning connection to connection factory");
                }
            }
        }
    }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method private verifyTables() : void from class datawave.query.metrics.ShardTableQueryMetricHandler


    protected CloseableIterable<QueryData> process(ScannerFactory scannerFactory, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper,
                    ShardQueryConfiguration config, String query, Query settings) throws DatawaveQueryException {
        final QueryData queryData = new QueryData();

        settingFuture = null;

        IteratorSetting cfg = null;

        if (preloadOptions) {
            cfg = getQueryIterator(metadataHelper, config, settings, "", false);
        }

        ASTJexlScript queryTree = null;
        try {
            queryTree = updateQueryTree(scannerFactory, metadataHelper, dateIndexHelper, config, query, queryData, settings);
        } catch (StackOverflowError e) {
            if (log.isTraceEnabled()) {
                log.trace("Stack trace for overflow " + e);
            }
            PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_DEPTH_OR_TERM_THRESHOLD_EXCEEDED, e);
            log.warn(qe);
            throw new DatawaveFatalQueryException(qe);
        } catch (NoResultsException e) {
            if (log.isTraceEnabled()) {
                log.trace("Definitively determined that no results exist from the indexes");
            }

            return DefaultQueryPlanner.emptyCloseableIterator();
        }

        final QueryStopwatch timers = config.getTimers();

        Tuple2<CloseableIterable<QueryPlan>,Boolean> queryRanges = getQueryRanges(scannerFactory, metadataHelper, config, queryTree);

        // a full table scan is required if
        final boolean isFullTable = queryRanges.second();

        // abort if we cannot handle full table scans
        if (isFullTable && !config.getFullTableScanEnabled()) {
            PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.FULL_TABLE_SCAN_REQUIRED_BUT_DISABLED);
            throw new FullTableScansDisallowedException(qe);
        }

        TraceStopwatch stopwatch = timers.newStartedStopwatch("DefaultQueryPlanner - Rebuild JEXL String from AST");

        // Set the final query after we're done mucking with it
        String newQueryString = JexlStringBuildingVisitor.buildQuery(queryTree);
        if (log.isTraceEnabled())
            log.trace("newQueryString is " + newQueryString);
        if (StringUtils.isBlank(newQueryString)) {
            stopwatch.stop();
            QueryException qe = new QueryException(DatawaveErrorCode.EMPTY_QUERY_STRING_AFTER_MODIFICATION);
            throw new DatawaveFatalQueryException(qe);
        }

        stopwatch.stop();
        stopwatch = timers.newStartedStopwatch("DefaultQueryPlanner - Construct IteratorSettings");

        queryData.setQuery(newQueryString);

        while (null == cfg) {
            cfg = getQueryIterator(metadataHelper, config, settings, "", false);
        }
        configureIterator(config, cfg, newQueryString, isFullTable);

        // Load the IteratorSettings into the QueryData instance
        queryData.setSettings(Lists.newArrayList(cfg));

        stopwatch.stop();

        this.plannedScript = newQueryString;
        // docsToCombineForEvaluation is only enabled when threading is used
        if (config.getMaxEvaluationPipelines() == 1)
            docsToCombineForEvaluation = -1;

        // add the geo query comparator to sort by geo range granularity if this is a geo query
        List<Comparator<QueryPlan>> queryPlanComparators = null;
        if (config.isSortGeoWaveQueryRanges()) {
            List<String> geoFields = new ArrayList<>();
            for (String fieldName : config.getIndexedFields()) {
                for (Type type : config.getQueryFieldsDatatypes().get(fieldName)) {
                    if (type instanceof GeometryType) {
                        geoFields.add(fieldName);
                        break;
                    }
                }
            }

            if (!geoFields.isEmpty()) {
                queryPlanComparators = new ArrayList<>();
                queryPlanComparators.add(new GeoWaveQueryPlanComparator(geoFields));
                queryPlanComparators.add(new DefaultQueryPlanComparator());
            }
        }

        // @formatter:off
        return new ThreadedRangeBundler.Builder()
                .setOriginal(queryData)
                .setQueryTree(queryTree)
                .setRanges(queryRanges.first())
                .setMaxRanges(maxRangesPerQueryPiece())
                .setDocsToCombine(docsToCombineForEvaluation)
                .setSettings(settings)
                .setDocSpecificLimitOverride(docSpecificOverride)
                .setMaxRangeWaitMillis(maxRangeWaitMillis)
                .setQueryPlanComparators(queryPlanComparators)
                .setNumRangesToBuffer(config.getNumRangesToBuffer())
                .setRangeBufferTimeoutMillis(config.getRangeBufferTimeoutMillis())
                .setRangeBufferPollMillis(config.getRangeBufferPollMillis())
                .build();
        // @formatter:on
    }

    protected CloseableIterable<QueryData> process(ScannerFactory scannerFactory, MetadataHelper metadataHelper, DateIndexHelper dateIndexHelper,
                    ShardQueryConfiguration config, String query, Query settings) throws DatawaveQueryException {
        final QueryData queryData = new QueryData();

        settingFuture = null;

        IteratorSetting cfg = null;

        if (preloadOptions) {
            cfg = getQueryIterator(metadataHelper, config, settings, "", false);
        }

        ASTJexlScript queryTree = null;
        try {
            queryTree = updateQueryTree(scannerFactory, metadataHelper, dateIndexHelper, config, query, queryData, settings);
        } catch (StackOverflowError e) {
            if (log.isTraceEnabled()) {
                log.trace("Stack trace for overflow " + e);
            }
            PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_DEPTH_OR_TERM_THRESHOLD_EXCEEDED, e);
            log.warn(qe);
            throw new DatawaveFatalQueryException(qe);
        } catch (NoResultsException e) {
            if (log.isTraceEnabled()) {
                log.trace("Definitively determined that no results exist from the indexes");
            }

            return DefaultQueryPlanner.emptyCloseableIterator();
        }

        final QueryStopwatch timers = config.getTimers();

        Tuple2<CloseableIterable<QueryPlan>,Boolean> queryRanges = getQueryRanges(scannerFactory, metadataHelper, config, queryTree);

        // a full table scan is required if
        final boolean isFullTable = queryRanges.second();

        // abort if we cannot handle full table scans
        if (isFullTable && !config.getFullTableScanEnabled()) {
            PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.FULL_TABLE_SCAN_REQUIRED_BUT_DISABLED);
            throw new FullTableScansDisallowedException(qe);
        }

        TraceStopwatch stopwatch = timers.newStartedStopwatch("DefaultQueryPlanner - Rebuild JEXL String from AST");

        // Set the final query after we're done mucking with it
        String newQueryString = JexlStringBuildingVisitor.buildQuery(queryTree);
        if (log.isTraceEnabled())
            log.trace("newQueryString is " + newQueryString);
        if (StringUtils.isBlank(newQueryString)) {
            stopwatch.stop();
            QueryException qe = new QueryException(DatawaveErrorCode.EMPTY_QUERY_STRING_AFTER_MODIFICATION);
            throw new DatawaveFatalQueryException(qe);
        }

        stopwatch.stop();
        stopwatch = timers.newStartedStopwatch("DefaultQueryPlanner - Construct IteratorSettings");

        queryData.setQuery(newQueryString);

        while (null == cfg) {
            cfg = getQueryIterator(metadataHelper, config, settings, "", false);
        }
        configureIterator(config, cfg, newQueryString, isFullTable);

        // Load the IteratorSettings into the QueryData instance
        queryData.setSettings(Lists.newArrayList(cfg));

        stopwatch.stop();

        this.plannedScript = newQueryString;
        // docsToCombineForEvaluation is only enabled when threading is used
        if (config.getMaxEvaluationPipelines() == 1)
            docsToCombineForEvaluation = -1;

        // add the geo query comparator to sort by geo range granularity if this is a geo query
        List<Comparator<QueryPlan>> queryPlanComparators = null;
        if (config.isSortGeoWaveQueryRanges()) {
            List<String> geoFields = new ArrayList<String>();
            for (String fieldName : config.getIndexedFields()) {
                for (Type type : config.getQueryFieldsDatatypes().get(fieldName)) {
                    if (type instanceof GeometryType) {
                        geoFields.add(fieldName);
                        break;
                    }
                }
            }

            if (!geoFields.isEmpty()) {
                queryPlanComparators = new ArrayList<>();
                queryPlanComparators.add(new GeoWaveQueryPlanComparator(geoFields));
                queryPlanComparators.add(new DefaultQueryPlanComparator());
            }
        }

        // @formatter:off
        return new ThreadedRangeBundler.Builder()
                .setOriginal(queryData)
                .setQueryTree(queryTree)
                .setRanges(queryRanges.first())
                .setMaxRanges(maxRangesPerQueryPiece())
                .setDocsToCombine(docsToCombineForEvaluation)
                .setSettings(settings)
                .setDocSpecificLimitOverride(docSpecificOverride)
                .setMaxRangeWaitMillis(maxRangeWaitMillis)
                .setQueryPlanComparators(queryPlanComparators)
                .setNumRangesToBuffer(config.getNumRangesToBuffer())
                .setRangeBufferTimeoutMillis(config.getRangeBufferTimeoutMillis())
                .setRangeBufferPollMillis(config.getRangeBufferPollMillis())
                .build();
        // @formatter:on
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method protected process(scannerFactory ScannerFactory, metadataHelper MetadataHelper, dateIndexHelper DateIndexHelper, config ShardQueryConfiguration, query String, settings Query) : CloseableIterable<QueryData> from class datawave.query.planner.DefaultQueryPlanner


    /**
     * Returns a Tuple2<Iterable<Range>,Boolean> whose elements represent the Ranges to use for querying the shard table and whether or not this is
     * a "full-table-scan" query.
     *
     * @param scannerFactory
     * @param metadataHelper
     * @param config
     * @param queryTree
     * @return
     * @throws DatawaveQueryException
     */
    public Tuple2<CloseableIterable<QueryPlan>,Boolean> getQueryRanges(ScannerFactory scannerFactory, MetadataHelper metadataHelper,
                    ShardQueryConfiguration config, JexlNode queryTree) throws DatawaveQueryException {
        Preconditions.checkNotNull(queryTree);

        boolean needsFullTable = false;
        CloseableIterable<QueryPlan> ranges = null;

        // if we still have an unexecutable tree, then a full table scan is
        // required
        List<String> debugOutput = null;
        if (log.isDebugEnabled()) {
            debugOutput = new ArrayList<>(32);
        }
        STATE state = ExecutableDeterminationVisitor.getState(queryTree, config, metadataHelper, debugOutput);
        if (log.isDebugEnabled()) {
            logDebug(debugOutput, "ExecutableDeterminationVisitor at getQueryRanges:");
        }
        if (state != STATE.EXECUTABLE) {
            if (state == STATE.ERROR) {
                log.warn("After expanding the query, it is determined that the query cannot be executed due to index-only fields mixed with expressions that cannot be run against the index.");
                BadRequestQueryException qe = new BadRequestQueryException(DatawaveErrorCode.INDEX_ONLY_FIELDS_MIXED_INVALID_EXPRESSIONS);
                throw new InvalidQueryException(qe);
            }
            log.warn("After expanding the query, it is determined that the query cannot be executed against the field index and a full table scan is required");
            needsFullTable = true;
        }

        // if a simple examination of the query has not forced a full table
        // scan, then lets try to compute ranges
        if (!needsFullTable) {

            // count the terms
            int termCount = TermCountingVisitor.countTerms(queryTree);
            if (termCount >= pushdownThreshold) {
                if (log.isTraceEnabled()) {
                    log.trace("pushing down query because it has " + termCount + " when our max is " + pushdownThreshold);
                }
                config.setCollapseUids(true);
            }
            TraceStopwatch stopwatch = config.getTimers().newStartedStopwatch("DefaultQueryPlanner - Begin stream of ranges from inverted index");

            RangeStream stream = initializeRangeStream(config, scannerFactory, metadataHelper);

            stream.setCondenseUids(condenseUidsInRangeStream);

            stream.setCompressUids(compressUidsInRangeStream);

            ranges = stream.streamPlans(queryTree);

            if (log.isTraceEnabled()) {
                log.trace("query stream is " + stream.context());
            }

            // if a term threshold is exceeded and we cannot handle that, then
            // throw unsupported
            boolean thresholdExceeded = StreamContext.EXCEEDED_TERM_THRESHOLD.equals(stream.context());
            if (thresholdExceeded && !config.canHandleExceededTermThreshold()) {
                throw new UnsupportedOperationException(EXCEED_TERM_EXPANSION_ERROR);
            }

            if (StreamContext.UNINDEXED.equals(stream.context())) {
                log.debug("Needs full table scan because of unindexed fields");
                needsFullTable = true;
            } else if (StreamContext.DELAYED_FIELD.equals(stream.context())) {
                log.debug("Needs full table scan because query consists of only delayed expressions");
                needsFullTable = true;
            }
            // if a value threshold is exceeded and we cannot handle that, then
            // force a full table scan
            else if (StreamContext.EXCEEDED_VALUE_THRESHOLD.equals(stream.context()) && !config.canHandleExceededValueThreshold()) {
                log.debug("Needs full table scan because we exceeded the value threshold and config.canHandleExceededValueThreshold() is false");
                needsFullTable = true;
            }

            stopwatch.stop();
        }
        if (needsFullTable) {
            if (config.getFullTableScanEnabled()) {
                ranges = this.getFullScanRange(config, queryTree);
            } else {
                if (log.isTraceEnabled())
                    log.trace("Full table scans are not enabled, query will not be run");
                QueryException qe = new QueryException(DatawaveErrorCode.FULL_TABLE_SCAN_REQUIRED_BUT_DISABLED);
                throw new FullTableScansDisallowedException(qe);
            }
            if (log.isTraceEnabled())
                log.trace("Ranges are " + ranges);
        }

        return new Tuple2<CloseableIterable<QueryPlan>,Boolean>(ranges, needsFullTable);
    }

    /**
     * Returns a Tuple2<Iterable<Range>,Boolean> whose elements represent the Ranges to use for querying the shard table and whether or not this is
     * a "full-table-scan" query.
     *
     * @param scannerFactory
     * @param metadataHelper
     * @param config
     * @param queryTree
     * @return
     * @throws DatawaveQueryException
     */
    public Tuple2<CloseableIterable<QueryPlan>,Boolean> getQueryRanges(ScannerFactory scannerFactory, MetadataHelper metadataHelper,
                    ShardQueryConfiguration config, JexlNode queryTree) throws DatawaveQueryException {
        Preconditions.checkNotNull(queryTree);

        boolean needsFullTable = false;
        CloseableIterable<QueryPlan> ranges = null;

        // if we still have an unexecutable tree, then a full table scan is
        // required
        List<String> debugOutput = null;
        if (log.isDebugEnabled()) {
            debugOutput = new ArrayList<String>(32);
        }
        STATE state = ExecutableDeterminationVisitor.getState(queryTree, config, metadataHelper, debugOutput);
        if (log.isDebugEnabled()) {
            logDebug(debugOutput, "ExecutableDeterminationVisitor at getQueryRanges:");
        }
        if (state != STATE.EXECUTABLE) {
            if (state == STATE.ERROR) {
                log.warn("After expanding the query, it is determined that the query cannot be executed due to index-only fields mixed with expressions that cannot be run against the index.");
                BadRequestQueryException qe = new BadRequestQueryException(DatawaveErrorCode.INDEX_ONLY_FIELDS_MIXED_INVALID_EXPRESSIONS);
                throw new InvalidQueryException(qe);
            }
            log.warn("After expanding the query, it is determined that the query cannot be executed against the field index and a full table scan is required");
            needsFullTable = true;
        }

        // if a simple examination of the query has not forced a full table
        // scan, then lets try to compute ranges
        if (!needsFullTable) {

            // count the terms
            int termCount = TermCountingVisitor.countTerms(queryTree);
            if (termCount >= pushdownThreshold) {
                if (log.isTraceEnabled()) {
                    log.trace("pushing down query because it has " + termCount + " when our max is " + pushdownThreshold);
                }
                config.setCollapseUids(true);
            }
            TraceStopwatch stopwatch = config.getTimers().newStartedStopwatch("DefaultQueryPlanner - Begin stream of ranges from inverted index");

            RangeStream stream = initializeRangeStream(config, scannerFactory, metadataHelper);

            stream.setCondenseUids(condenseUidsInRangeStream);

            stream.setCompressUids(compressUidsInRangeStream);

            ranges = stream.streamPlans(queryTree);

            if (log.isTraceEnabled()) {
                log.trace("query stream is " + stream.context());
            }

            // if a term threshold is exceeded and we cannot handle that, then
            // throw unsupported
            boolean thresholdExceeded = StreamContext.EXCEEDED_TERM_THRESHOLD.equals(stream.context());
            if (thresholdExceeded && !config.canHandleExceededTermThreshold()) {
                throw new UnsupportedOperationException(EXCEED_TERM_EXPANSION_ERROR);
            }

            if (StreamContext.UNINDEXED.equals(stream.context())) {
                log.debug("Needs full table scan because of unindexed fields");
                needsFullTable = true;
            } else if (StreamContext.DELAYED_FIELD.equals(stream.context())) {
                log.debug("Needs full table scan because query consists of only delayed expressions");
                needsFullTable = true;
            }
            // if a value threshold is exceeded and we cannot handle that, then
            // force a full table scan
            else if (StreamContext.EXCEEDED_VALUE_THRESHOLD.equals(stream.context()) && !config.canHandleExceededValueThreshold()) {
                log.debug("Needs full table scan because we exceeded the value threshold and config.canHandleExceededValueThreshold() is false");
                needsFullTable = true;
            }

            stopwatch.stop();
        }
        if (needsFullTable) {
            if (config.getFullTableScanEnabled()) {
                ranges = this.getFullScanRange(config, queryTree);
            } else {
                if (log.isTraceEnabled())
                    log.trace("Full table scans are not enabled, query will not be run");
                QueryException qe = new QueryException(DatawaveErrorCode.FULL_TABLE_SCAN_REQUIRED_BUT_DISABLED);
                throw new FullTableScansDisallowedException(qe);
            }
            if (log.isTraceEnabled())
                log.trace("Ranges are " + ranges);
        }

        return new Tuple2<CloseableIterable<QueryPlan>,Boolean>(ranges, needsFullTable);
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getQueryRanges(scannerFactory ScannerFactory, metadataHelper MetadataHelper, config ShardQueryConfiguration, queryTree JexlNode) : Tuple2<CloseableIterable<QueryPlan>,Boolean> from class datawave.query.planner.DefaultQueryPlanner


    protected Range getRange(Set<Key> keys) {
        // building a range from the begining of the term frequencies for the first datatype\0uid
        // to the end of the term frequencies for the last datatype\0uid
        List<String> dataTypeUids = new ArrayList<>();
        Text row = null;
        for (Key key : keys) {
            row = key.getRow();
            dataTypeUids.add(key.getColumnFamily().toString());
        }
        Collections.sort(dataTypeUids);

        Key startKey = new Key(row, Constants.TERM_FREQUENCY_COLUMN_FAMILY, new Text(dataTypeUids.get(0)));
        Key endKey = new Key(row, Constants.TERM_FREQUENCY_COLUMN_FAMILY, new Text(dataTypeUids.get(dataTypeUids.size() - 1) + '\1'));
        return new Range(startKey, true, endKey, true);
    }

    protected Range getRange(Set<Key> keys) {
        // building a range from the begining of the term frequencies for the first datatype\0uid
        // to the end of the term frequencies for the last datatype\0uid
        List<String> dataTypeUids = new ArrayList<String>();
        Text row = null;
        for (Key key : keys) {
            row = key.getRow();
            dataTypeUids.add(key.getColumnFamily().toString());
        }
        Collections.sort(dataTypeUids);

        Key startKey = new Key(row, Constants.TERM_FREQUENCY_COLUMN_FAMILY, new Text(dataTypeUids.get(0)));
        Key endKey = new Key(row, Constants.TERM_FREQUENCY_COLUMN_FAMILY, new Text(dataTypeUids.get(dataTypeUids.size() - 1) + '\1'));
        return new Range(startKey, true, endKey, true);
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method protected getRange(keys Set<Key>) : Range from class datawave.query.postprocessing.tf.TermOffsetPopulator


    private static Set<String> getNormalizedTerms(String originalTerm, String zone, Multimap<String,Class<? extends Type<?>>> dataTypes,
                    Map<Class<? extends Type<?>>,Type<?>> dataTypeCacheMap) {

        Set<String> normalizedTerms = new HashSet<>();

        Collection<Class<? extends Type<?>>> dataTypesForZone = dataTypes.get(zone);
        if (dataTypesForZone.isEmpty()) {
            dataTypesForZone = Collections.<Class<? extends Type<?>>> singleton(NoOpType.class);
        }

        // Get the dataType version of the term for each dataType set up on
        // the zone (field)
        for (Class<? extends Type<?>> dataTypeClass : dataTypesForZone) {
            Type<?> dataTypeInstance = null;

            // Get an instance of the dataType
            if (dataTypeCacheMap.containsKey(dataTypeClass) && dataTypeCacheMap.get(dataTypeClass) != null) {
                dataTypeInstance = dataTypeCacheMap.get(dataTypeClass);
            } else {
                // If we don't have an instance of the dataType, make one and put it
                // in the cache
                try {
                    dataTypeInstance = dataTypeClass.newInstance();
                } catch (InstantiationException e) {
                    log.error("Could not instantiate dataType class: " + dataTypeClass);
                    continue;
                } catch (IllegalAccessException e) {
                    log.error("IllegalAccessException when trying to create dataType: " + dataTypeClass);
                    continue;
                }

                dataTypeCacheMap.put(dataTypeClass, dataTypeInstance);
            }

            // Add the normalized term to the list
            try {
                normalizedTerms.add(dataTypeInstance.normalize(originalTerm));
            } catch (Exception e) {
                log.error("Unable to normalize " + zone + " = " + originalTerm + " using " + dataTypeClass + ", using original value");
                normalizedTerms.add(originalTerm);
            }
        }

        // Return the list of terms
        return normalizedTerms;
    }

    private static Set<String> getNormalizedTerms(String originalTerm, String zone, Multimap<String,Class<? extends Type<?>>> dataTypes,
                    Map<Class<? extends Type<?>>,Type<?>> dataTypeCacheMap) {

        Set<String> normalizedTerms = new HashSet<String>();

        Collection<Class<? extends Type<?>>> dataTypesForZone = dataTypes.get(zone);
        if (dataTypesForZone.isEmpty()) {
            dataTypesForZone = Collections.<Class<? extends Type<?>>> singleton(NoOpType.class);
        }

        // Get the dataType version of the term for each dataType set up on
        // the zone (field)
        for (Class<? extends Type<?>> dataTypeClass : dataTypesForZone) {
            Type<?> dataTypeInstance = null;

            // Get an instance of the dataType
            if (dataTypeCacheMap.containsKey(dataTypeClass) && dataTypeCacheMap.get(dataTypeClass) != null) {
                dataTypeInstance = dataTypeCacheMap.get(dataTypeClass);
            } else {
                // If we don't have an instance of the dataType, make one and put it
                // in the cache
                try {
                    dataTypeInstance = dataTypeClass.newInstance();
                } catch (InstantiationException e) {
                    log.error("Could not instantiate dataType class: " + dataTypeClass);
                    continue;
                } catch (IllegalAccessException e) {
                    log.error("IllegalAccessException when trying to create dataType: " + dataTypeClass);
                    continue;
                }

                dataTypeCacheMap.put(dataTypeClass, dataTypeInstance);
            }

            // Add the normalized term to the list
            try {
                normalizedTerms.add(dataTypeInstance.normalize(originalTerm));
            } catch (Exception e) {
                log.error("Unable to normalize " + zone + " = " + originalTerm + " using " + dataTypeClass + ", using original value");
                normalizedTerms.add(originalTerm);
            }
        }

        // Return the list of terms
        return normalizedTerms;
    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method private getNormalizedTerms(originalTerm String, zone String, dataTypes Multimap<String,Class<? extends Type<?>>>, dataTypeCacheMap Map<Class<? extends Type<?>>,Type<?>>) : Set<String> from class datawave.query.postprocessing.tf.TermOffsetPopulator


    public static Multimap<String,String> getTermFrequencyFieldValues(Multimap<String,Function> functions, Set<String> contentExpansionFields,
                    Multimap<String,String> queryFieldValues, Multimap<String,Class<? extends Type<?>>> dataTypes) {
        // get the intersection of the content expansion fields (or term frequency fields) and those that are in the content functions
        Multimap<String,String> contentFieldValues = getContentFieldValues(contentExpansionFields, dataTypes, functions);

        // now get the intersection of the content function values and those literals in the query:
        Multimap<String,String> termFrequencyFieldValues = HashMultimap.create();
        for (String key : contentFieldValues.keySet()) {
            Collection<String> contentValues = contentFieldValues.get(key);
            Collection<String> queryValues = queryFieldValues.get(key);
            Set<String> intersection = new HashSet<>(contentValues);
            intersection.retainAll(queryValues);
            if (!intersection.isEmpty()) {
                termFrequencyFieldValues.putAll(key, intersection);
            }
        }
        return termFrequencyFieldValues;
    }

    public static Multimap<String,String> getTermFrequencyFieldValues(Multimap<String,Function> functions, Set<String> contentExpansionFields,
                    Multimap<String,String> queryFieldValues, Multimap<String,Class<? extends Type<?>>> dataTypes) {
        // get the intersection of the content expansion fields (or term frequency fields) and those that are in the content functions
        Multimap<String,String> contentFieldValues = getContentFieldValues(contentExpansionFields, dataTypes, functions);

        // now get the intersection of the content function values and those literals in the query:
        Multimap<String,String> termFrequencyFieldValues = HashMultimap.create();
        for (String key : contentFieldValues.keySet()) {
            Collection<String> contentValues = contentFieldValues.get(key);
            Collection<String> queryValues = queryFieldValues.get(key);
            Set<String> intersection = new HashSet<String>(contentValues);
            intersection.retainAll(queryValues);
            if (!intersection.isEmpty()) {
                termFrequencyFieldValues.putAll(key, intersection);
            }
        }
        return termFrequencyFieldValues;
    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method public getTermFrequencyFieldValues(functions Multimap<String,Function>, contentExpansionFields Set<String>, queryFieldValues Multimap<String,String>, dataTypes Multimap<String,Class<? extends Type<?>>>) : Multimap<String,String> from class datawave.query.postprocessing.tf.TermOffsetPopulator


        public void setMarkings(Map<String,String> markings) {
            this.markings = (markings == null ? new HashMap<>() : new HashMap<>(markings));
        }

        public void setMarkings(Map<String,String> markings) {
            this.markings = (markings == null ? new HashMap<String,String>() : new HashMap<String,String>(markings));
        }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method public setMarkings(markings Map<String,String>) : void from class datawave.query.table.parser.EventKeyValueFactory.EventKeyValue


    public BatchScannerSession setThreads(int threads) {
        if (service != null)
            service.shutdownNow();
        this.threadCount = threads;
        service = new ThreadPoolExecutor(threads, threads, 120, TimeUnit.MINUTES, new LinkedBlockingQueue<>(), new BatchReaderThreadFactory(threadId, this));
        service = MoreExecutors.listeningDecorator(service);
        return this;
    }

    public BatchScannerSession setThreads(int threads) {
        if (service != null)
            service.shutdownNow();
        this.threadCount = threads;
        service = new ThreadPoolExecutor(threads, threads, 120, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>(), new BatchReaderThreadFactory(threadId,
                        this));
        service = MoreExecutors.listeningDecorator(service);
        return this;
    }

Replace Generic With Diamond ThreadPoolExecutor with ThreadPoolExecutor in method public setThreads(threads int) : BatchScannerSession from class datawave.query.tables.BatchScannerSession


    public DedupingIterator(Iterator<Entry<Key,Value>> iterator) {
        this.delegate = iterator;
        this.bloom = BloomFilter.create(new ByteFunnel(), 500000, 1e-15);
        if (DEBUG) {
            this.seen = new HashSet<>();
        }
        getNext();
    }

    public DedupingIterator(Iterator<Entry<Key,Value>> iterator) {
        this.delegate = iterator;
        this.bloom = BloomFilter.create(new ByteFunnel(), 500000, 1e-15);
        if (DEBUG) {
            this.seen = new HashSet<ByteSequence>();
        }
        getNext();
    }

Replace Generic With Diamond HashSet<ByteSequence> with HashSet<> in method public DedupingIterator(iterator Iterator<Entry<Key,Value>>) from class datawave.query.tables.DedupingIterator


    protected int scannerInvariant(final Iterator<Entry<Key,Value>> iter) {
        PeekingIterator<Entry<Key,Value>> kvIter = new PeekingIterator<>(iter);

        int retrievalCount = 0;

        Entry<Key,Value> myEntry = null;

        String currentDay = null;

        if (null != prevDay) {
            try {
                if (log.isTraceEnabled())
                    log.trace("Attempting to insert " + prevDay);
                if (!resultQueue.offer(prevDay, 1, TimeUnit.SECONDS)) {
                    return 0;
                }
                prevDay = null;
            } catch (InterruptedException e) {
                return 0;
            }
        }
        // produces stats for us, so we don't have to!
        DescriptiveStatistics stats = new DescriptiveStatistics();

        writeLock.lock();
        try {
            while (kvIter.hasNext()) {
                Entry<Key,Value> currentKeyValue = kvIter.peek();

                IndexInfo infos = new IndexInfo();
                try {
                    infos.readFields(new DataInputStream(new ByteArrayInputStream(currentKeyValue.getValue().get())));
                    for (IndexMatch match : infos.uids()) {
                        log.trace("match is " + match.getUid().split("\u0000")[1]);
                    }
                } catch (IOException e) {
                    log.error(e);
                }

                // become a passthrough if we've seen an unexpected key.
                if (seenUnexpectedKey) {
                    currentQueue.add(currentKeyValue);

                    break;
                }

                if (null == currentDay) {
                    if (log.isTraceEnabled()) {
                        log.trace("it's a new day!");
                    }

                    if (log.isTraceEnabled()) {
                        log.trace("adding " + currentKeyValue.getKey() + " to queue because it matches" + currentDay);
                    }

                    currentDay = getDay(currentKeyValue.getKey());

                    currentQueue.add(currentKeyValue);

                    lastSeenKey = kvIter.next().getKey();
                } else {
                    String nextKeysDay = getDay(currentKeyValue.getKey());
                    if (currentDay.equals(nextKeysDay)) {
                        if (log.isTraceEnabled()) {
                            log.trace("adding " + currentKeyValue.getKey() + " to queue because it matches" + currentDay);
                        }

                        IndexInfo info = new IndexInfo();
                        try {
                            info.readFields(new DataInputStream(new ByteArrayInputStream(currentKeyValue.getValue().get())));
                        } catch (IOException e) {
                            throw new DatawaveFatalQueryException(e);
                        }

                        if (log.isTraceEnabled()) {
                            log.trace("adding count of " + info.count());
                        }

                        stats.addValue(info.count());

                        if (currentQueue.size() <= shardsPerDayThreshold
                                        || (currentQueue.size() >= shardsPerDayThreshold && stats.getPercentile(50) < MAX_MEDIAN)) {

                            if (log.isTraceEnabled()) {
                                log.trace("adding our stats are " + stats.getPercentile(50) + " on " + currentQueue.size());
                            }

                            currentQueue.add(currentKeyValue);

                        } else {
                            if (log.isTraceEnabled()) {
                                log.trace("breaking because our stats are " + stats.getPercentile(50) + " on " + currentQueue.size());
                            }
                            break;

                        }
                        lastSeenKey = kvIter.next().getKey();
                    } else {

                        int dequeueCount = dequeue();
                        retrievalCount += dequeueCount;
                        int queueSize = currentQueue.size();
                        dequeue(true);
                        currentDay = null;

                        if (dequeueCount != queueSize || retrievalCount <= Math.ceil(maxResults * 1.5)) {
                            break;
                        }

                    }
                }

            }

            if (currentQueue.size() >= shardsPerDayThreshold && stats.getPercentile(50) > MAX_MEDIAN) {

                Entry<Key,Value> top = currentQueue.poll();

                Key topKey = top.getKey();
                if (log.isTraceEnabled())
                    log.trace(topKey + " for " + currentDay + " exceeds limit of " + shardsPerDayThreshold + " with " + currentQueue.size());
                Key newKey = new Key(topKey.getRow(), topKey.getColumnFamily(), new Text(currentDay), topKey.getColumnVisibility(), topKey.getTimestamp());

                IndexInfo info = new IndexInfo(-1);

                Value newValue = null;
                try {

                    ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
                    DataOutputStream outDataStream = new DataOutputStream(outByteStream);
                    info.write(outDataStream);

                    outDataStream.close();
                    outByteStream.close();

                    newValue = new Value(outByteStream.toByteArray());
                } catch (IOException e) {
                    throw new DatawaveFatalQueryException(e);
                }

                myEntry = Maps.immutableEntry(newKey, newValue);
                lastSeenKey = newKey;

                try {
                    if (!resultQueue.offer(myEntry, 1, TimeUnit.SECONDS)) {
                        log.trace("could not add day! converting " + myEntry + " to " + prevDay);
                        prevDay = myEntry;

                    }

                } catch (InterruptedException exception) {
                    prevDay = myEntry;
                }

                currentQueue.clear();

            } else {
                retrievalCount += dequeue();
            }
        } finally {
            writeLock.unlock();
        }
        return retrievalCount;
    }

    protected int scannerInvariant(final Iterator<Entry<Key,Value>> iter) {
        PeekingIterator<Entry<Key,Value>> kvIter = new PeekingIterator<Entry<Key,Value>>(iter);

        int retrievalCount = 0;

        Entry<Key,Value> myEntry = null;

        String currentDay = null;

        if (null != prevDay) {
            try {
                if (log.isTraceEnabled())
                    log.trace("Attempting to insert " + prevDay);
                if (!resultQueue.offer(prevDay, 1, TimeUnit.SECONDS)) {
                    return 0;
                }
                prevDay = null;
            } catch (InterruptedException e) {
                return 0;
            }
        }
        // produces stats for us, so we don't have to!
        DescriptiveStatistics stats = new DescriptiveStatistics();

        writeLock.lock();
        try {
            while (kvIter.hasNext()) {
                Entry<Key,Value> currentKeyValue = kvIter.peek();

                IndexInfo infos = new IndexInfo();
                try {
                    infos.readFields(new DataInputStream(new ByteArrayInputStream(currentKeyValue.getValue().get())));
                    for (IndexMatch match : infos.uids()) {
                        log.trace("match is " + match.getUid().split("\u0000")[1]);
                    }
                } catch (IOException e) {
                    log.error(e);
                }

                // become a passthrough if we've seen an unexpected key.
                if (seenUnexpectedKey) {
                    currentQueue.add(currentKeyValue);

                    break;
                }

                if (null == currentDay) {
                    if (log.isTraceEnabled()) {
                        log.trace("it's a new day!");
                    }

                    if (log.isTraceEnabled()) {
                        log.trace("adding " + currentKeyValue.getKey() + " to queue because it matches" + currentDay);
                    }

                    currentDay = getDay(currentKeyValue.getKey());

                    currentQueue.add(currentKeyValue);

                    lastSeenKey = kvIter.next().getKey();
                } else {
                    String nextKeysDay = getDay(currentKeyValue.getKey());
                    if (currentDay.equals(nextKeysDay)) {
                        if (log.isTraceEnabled()) {
                            log.trace("adding " + currentKeyValue.getKey() + " to queue because it matches" + currentDay);
                        }

                        IndexInfo info = new IndexInfo();
                        try {
                            info.readFields(new DataInputStream(new ByteArrayInputStream(currentKeyValue.getValue().get())));
                        } catch (IOException e) {
                            throw new DatawaveFatalQueryException(e);
                        }

                        if (log.isTraceEnabled()) {
                            log.trace("adding count of " + info.count());
                        }

                        stats.addValue(info.count());

                        if (currentQueue.size() <= shardsPerDayThreshold
                                        || (currentQueue.size() >= shardsPerDayThreshold && stats.getPercentile(50) < MAX_MEDIAN)) {

                            if (log.isTraceEnabled()) {
                                log.trace("adding our stats are " + stats.getPercentile(50) + " on " + currentQueue.size());
                            }

                            currentQueue.add(currentKeyValue);

                        } else {
                            if (log.isTraceEnabled()) {
                                log.trace("breaking because our stats are " + stats.getPercentile(50) + " on " + currentQueue.size());
                            }
                            break;

                        }
                        lastSeenKey = kvIter.next().getKey();
                    } else {

                        int dequeueCount = dequeue();
                        retrievalCount += dequeueCount;
                        int queueSize = currentQueue.size();
                        dequeue(true);
                        currentDay = null;

                        if (dequeueCount != queueSize || retrievalCount <= Math.ceil(maxResults * 1.5)) {
                            break;
                        }

                    }
                }

            }

            if (currentQueue.size() >= shardsPerDayThreshold && stats.getPercentile(50) > MAX_MEDIAN) {

                Entry<Key,Value> top = currentQueue.poll();

                Key topKey = top.getKey();
                if (log.isTraceEnabled())
                    log.trace(topKey + " for " + currentDay + " exceeds limit of " + shardsPerDayThreshold + " with " + currentQueue.size());
                Key newKey = new Key(topKey.getRow(), topKey.getColumnFamily(), new Text(currentDay), topKey.getColumnVisibility(), topKey.getTimestamp());

                IndexInfo info = new IndexInfo(-1);

                Value newValue = null;
                try {

                    ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
                    DataOutputStream outDataStream = new DataOutputStream(outByteStream);
                    info.write(outDataStream);

                    outDataStream.close();
                    outByteStream.close();

                    newValue = new Value(outByteStream.toByteArray());
                } catch (IOException e) {
                    throw new DatawaveFatalQueryException(e);
                }

                myEntry = Maps.immutableEntry(newKey, newValue);
                lastSeenKey = newKey;

                try {
                    if (!resultQueue.offer(myEntry, 1, TimeUnit.SECONDS)) {
                        log.trace("could not add day! converting " + myEntry + " to " + prevDay);
                        prevDay = myEntry;

                    }

                } catch (InterruptedException exception) {
                    prevDay = myEntry;
                }

                currentQueue.clear();

            } else {
                retrievalCount += dequeue();
            }
        } finally {
            writeLock.unlock();
        }
        return retrievalCount;
    }

Replace Generic With Diamond PeekingIterator<Entry<Key,Value>> with PeekingIterator<> in method protected scannerInvariant(iter Iterator<Entry<Key,Value>>) : int from class datawave.query.tables.RangeStreamScanner


    public static IteratorSetting configureVisibilityPruning(int stackPosition, Set<Authorizations> auths, Set<String> unDisplayed) {

        Set<String> myUnDisplayedVisibilities = Sets.newTreeSet(unDisplayed == null ? new TreeSet<>() : unDisplayed);

        IteratorSetting is = new IteratorSetting(stackPosition, VisibilityPruningIterator.class);
        String stringifiedBlacklist = StringUtils.join(myUnDisplayedVisibilities.iterator(), ',');
        is.addOption(VisibilityPruningIterator.BLACKLIST, stringifiedBlacklist);
        Iterator<String> authSets = Iterators.transform(auths.iterator(), Functions.toStringFunction());
        String stringifiedAuths = StringUtils.join(authSets, ',');
        is.addOption(VisibilityPruningIterator.AUTHORIZATIONS, stringifiedAuths);
        return is;
    }

    public static IteratorSetting configureVisibilityPruning(int stackPosition, Set<Authorizations> auths, Set<String> unDisplayed) {

        Set<String> myUnDisplayedVisibilities = Sets.newTreeSet(unDisplayed == null ? new TreeSet<String>() : unDisplayed);

        IteratorSetting is = new IteratorSetting(stackPosition, VisibilityPruningIterator.class);
        String stringifiedBlacklist = StringUtils.join(myUnDisplayedVisibilities.iterator(), ',');
        is.addOption(VisibilityPruningIterator.BLACKLIST, stringifiedBlacklist);
        Iterator<String> authSets = Iterators.transform(auths.iterator(), Functions.toStringFunction());
        String stringifiedAuths = StringUtils.join(authSets, ',');
        is.addOption(VisibilityPruningIterator.AUTHORIZATIONS, stringifiedAuths);
        return is;
    }

Replace Generic With Diamond TreeSet<String> with TreeSet<> in method public configureVisibilityPruning(stackPosition int, auths Set<Authorizations>, unDisplayed Set<String>) : IteratorSetting from class datawave.query.tables.ShardIndexQueryTable


    public void setFilterOptions(final Map<String,String> options) {
        if (null != options) {
            filterOptions = new HashMap<>(options);
        } else {
            filterOptions = null;
        }
    }

    public void setFilterOptions(final Map<String,String> options) {
        if (null != options) {
            filterOptions = new HashMap<String,String>(options);
        } else {
            filterOptions = null;
        }
    }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method public setFilterOptions(options Map<String,String>) : void from class datawave.query.tables.ShardQueryLogic


    /**
     * Parses the Jexl Query string into an ASTJexlScript and then uses QueryModelVisitor to apply the loaded model to the query string, and then rewrites the
     * translated ASTJexlScript back to a query string using JexlStringBuildingVisitor.
     *
     * @param queryString
     * @return modified query string
     */
    protected String applyQueryModel(String queryString) {
        ASTJexlScript origScript = null;
        ASTJexlScript script = null;
        try {
            origScript = JexlASTHelper.parseJexlQuery(queryString);
            HashSet<String> allFields = new HashSet<>();
            allFields.addAll(getEdgeQueryModel().getAllInternalFieldNames());
            script = QueryModelVisitor.applyModel(origScript, getEdgeQueryModel(), allFields);
            return JexlStringBuildingVisitor.buildQuery(script);

        } catch (Throwable t) {
            throw new IllegalStateException("Edge query model could not be applied", t);
        }
    }

    /**
     * Parses the Jexl Query string into an ASTJexlScript and then uses QueryModelVisitor to apply the loaded model to the query string, and then rewrites the
     * translated ASTJexlScript back to a query string using JexlStringBuildingVisitor.
     *
     * @param queryString
     * @return modified query string
     */
    protected String applyQueryModel(String queryString) {
        ASTJexlScript origScript = null;
        ASTJexlScript script = null;
        try {
            origScript = JexlASTHelper.parseJexlQuery(queryString);
            HashSet<String> allFields = new HashSet<String>();
            allFields.addAll(getEdgeQueryModel().getAllInternalFieldNames());
            script = QueryModelVisitor.applyModel(origScript, getEdgeQueryModel(), allFields);
            return JexlStringBuildingVisitor.buildQuery(script);

        } catch (Throwable t) {
            throw new IllegalStateException("Edge query model could not be applied", t);
        }
    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method protected applyQueryModel(queryString String) : String from class datawave.query.tables.edge.DefaultEdgeEventQueryLogic


    /**
     * Parses the Jexl Query string into an ASTJexlScript and then uses QueryModelVisitor to apply queryModel to the query string, and then rewrites the
     * translated ASTJexlScript back to a query string using JexlStringBuildingVisitor.
     *
     * @param queryString
     * @return
     */
    protected String applyQueryModel(String queryString) {
        ASTJexlScript origScript = null;
        ASTJexlScript script = null;
        try {
            origScript = JexlASTHelper.parseJexlQuery(queryString);
            HashSet<String> allFields = new HashSet<>();
            allFields.addAll(getEdgeQueryModel().getAllInternalFieldNames());
            script = QueryModelVisitor.applyModel(origScript, getEdgeQueryModel(), allFields);
            return JexlStringBuildingVisitor.buildQuery(script);

        } catch (Throwable t) {
            throw new IllegalStateException("Edge query model could not be applied", t);
        }
    }

    /**
     * Parses the Jexl Query string into an ASTJexlScript and then uses QueryModelVisitor to apply queryModel to the query string, and then rewrites the
     * translated ASTJexlScript back to a query string using JexlStringBuildingVisitor.
     *
     * @param queryString
     * @return
     */
    protected String applyQueryModel(String queryString) {
        ASTJexlScript origScript = null;
        ASTJexlScript script = null;
        try {
            origScript = JexlASTHelper.parseJexlQuery(queryString);
            HashSet<String> allFields = new HashSet<String>();
            allFields.addAll(getEdgeQueryModel().getAllInternalFieldNames());
            script = QueryModelVisitor.applyModel(origScript, getEdgeQueryModel(), allFields);
            return JexlStringBuildingVisitor.buildQuery(script);

        } catch (Throwable t) {
            throw new IllegalStateException("Edge query model could not be applied", t);
        }
    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method protected applyQueryModel(queryString String) : String from class datawave.query.tables.edge.EdgeQueryLogic