public static String formatSet(@NonNull EnumSet<Quantity> set) { List<String> list = new ArrayList<>(set.size()); for (Quantity quantity : set) { list.add('`' + quantity.name() + '`'); } return LintUtils.formatList(list, Integer.MAX_VALUE); } }
public static String formatSet(@NonNull EnumSet<Quantity> set) { List<String> list = new ArrayList<String>(set.size()); for (Quantity quantity : set) { list.add('`' + quantity.name() + '`'); } return LintUtils.formatList(list, Integer.MAX_VALUE); } }
private static boolean checkForTyposInTags(XmlContext context, Element node, Collection<String> validPossibleTags) { String tagName = node.getTagName(); List<String> suggestions = generateTypoSuggestions(tagName, validPossibleTags); if (suggestions != null) { assert !suggestions.isEmpty(); String suggestionString; if (suggestions.size() == 1) { suggestionString = suggestions.get(0); } else if (suggestions.size() == 2) { suggestionString = String.format("%1$s or %2$s", suggestions.get(0), suggestions.get(1)); } else { suggestionString = LintUtils.formatList(suggestions, -1); } String message = String.format("Misspelled tag `<%1$s>`: Did you mean `%2$s` ?", tagName, suggestionString); context.report(ISSUE, node, context.getNameLocation(node), message); return true; } return false; }
+ "layout configurations: %3$s (missing from %4$s)", id, layout, LintUtils.formatList(layouts, Integer.MAX_VALUE), LintUtils.formatList(missing, Integer.MAX_VALUE)); } else { message = String.format( "The id \"%1$s\" in layout \"%2$s\" is missing from the following layout " + "configurations: %3$s (present in %4$s)", id, layout, LintUtils.formatList(missing, Integer.MAX_VALUE), LintUtils.formatList(layouts, Integer.MAX_VALUE));
suggestions.get(0), suggestions.get(1)); } else { suggestionString = LintUtils.formatList(suggestions, -1);
+ "layout configurations: %3$s (missing from %4$s)", id, layout, LintUtils.formatList(layouts, Integer.MAX_VALUE), LintUtils.formatList(missing, Integer.MAX_VALUE)); } else { message = String.format( "The id \"%1$s\" in layout \"%2$s\" is missing from the following layout " + "configurations: %3$s (present in %4$s)", id, layout, LintUtils.formatList(missing, Integer.MAX_VALUE), LintUtils.formatList(layouts, Integer.MAX_VALUE));
suggestions.get(0), suggestions.get(1)); } else { suggestionString = LintUtils.formatList(suggestions, -1);
context.client.report(context, MISSING, location, String.format("Locale %1$s is missing translations for: %2$s", language, LintUtils.formatList(sorted, 4)), null); context.client.report(context, EXTRA, location, String.format( "Locale %1$s is translating names not found in default locale: %2$s", language, LintUtils.formatList(sorted, 4)), null);
LintUtils.formatList(missing, missing.size())), null); String.format( "The following images appear in both -nodpi and in a density folder: %1$s", LintUtils.formatList(list, 10)), null); LintUtils.formatList(defined, 5)); "Missing the following drawables in %1$s: %2$s%3$s", file.getName(), LintUtils.formatList(delta, 5), foundIn), null);
String.format("Missing density variation folders in `%1$s`: %2$s", context.getProject().getDisplayPath(res), LintUtils.formatList(missing, -1))); String.format( "The following images appear in both `-nodpi` and in a density folder: %1$s", LintUtils.formatList(list, context.getDriver().isAbbreviating() ? 10 : -1))); String.format( "The following images appear both as density independent `.xml` files and as bitmap files: %1$s", LintUtils.formatList(fileNames, context.getDriver().isAbbreviating() ? 10 : -1))); LintUtils.formatList(defined, context.getDriver().isAbbreviating() ? 5 : -1)); "Missing the following drawables in `%1$s`: %2$s%3$s", folder, LintUtils.formatList(delta, context.getDriver().isAbbreviating() ? 5 : -1), foundIn));
String.format("Missing density variation folders in `%1$s`: %2$s", context.getProject().getDisplayPath(res), LintUtils.formatList(missing, -1))); String.format( "The following images appear in both `-nodpi` and in a density folder: %1$s", LintUtils.formatList(list, context.getDriver().isAbbreviating() ? 10 : -1))); String.format( "The following images appear both as density independent `.xml` files and as bitmap files: %1$s", LintUtils.formatList(fileNames, context.getDriver().isAbbreviating() ? 10 : -1))); LintUtils.formatList(defined, context.getDriver().isAbbreviating() ? 5 : -1)); "Missing the following drawables in `%1$s`: %2$s%3$s", folder, LintUtils.formatList(delta, context.getDriver().isAbbreviating() ? 5 : -1), foundIn));
Attr digestAttr = child.getAttributeNode(ATTR_DIGEST); if (!PIN_DIGEST_ALGORITHM.equalsIgnoreCase(digestAttr.getValue())) { String values = LintUtils.formatList(getSupportedPinDigestAlgorithms(), 2); context.report(ISSUE, digestAttr, context.getValueLocation(digestAttr), String.format(INVALID_DIGEST_ALGORITHM, values));