@VisibleForTesting String getReturnType(String className, Segment entry) { for (AutocompleteEntry entryObj : autocompleteEntryHolder.getEntriesForTypeName(className)) { if (entryObj.getEntryName().equals(entry.getValue())) { return parseReturnType(entryObj.getReturnType(), entry.isArrayElement()); } } return ""; }
/** * Handling the first segment in an expression. This gets the type of the segment which is first * in an expression and accounts for cases in which this segment is an array. */ private String getFirstReturnType(Segment first, int maxRecursionDepth) { if (maxRecursionDepth <= 0) { return ""; } if (first.isRawArray()) { return ARRAY_TYPE; } String str = first.getValue(); if (isTopLevelClass(str)) { return str; } else if (variableTypes.containsKey(str)) { return parseReturnType( getPossibleClass(variableTypes.get(str), maxRecursionDepth - 1), first.isArrayElement()); } else { return ""; } }