Source:
<code>private static LinkedHashMap<Integer, String> getPlaceholders(@Nullable GoExpression argument) { if (argument == null) return null; String placeholderText = resolve(argument); if (placeholderText == null) return null; int placeholderTextLength = placeholderText.length(); int placeholderStart = 0; LinkedHashMap<Integer, String> placeholders = new LinkedHashMap<Integer, String>(); while (placeholderStart < placeholderTextLength) { ProgressManager.checkCanceled(); if (PLACEHOLDER_START_CHAR != placeholderText.charAt(placeholderStart)) { placeholderStart++; continue; } int placeholderEnd = placeholderStart + 1; while (placeholderEnd < placeholderTextLength && <START> PLACEHOLDER_ALLOWED_CHARS.indexOf(placeholderText.charAt(placeholderEnd)) != -1 && <END> PLACEHOLDER_END_CHARS.indexOf(placeholderText.charAt(placeholderEnd)) == -1) { placeholderEnd++; } if (placeholderEnd >= placeholderTextLength) break; if (PLACEHOLDER_ALLOWED_CHARS.indexOf(placeholderText.charAt(placeholderEnd)) == -1 && PLACEHOLDER_END_CHARS.indexOf(placeholderText.charAt(placeholderEnd)) == -1) { placeholderStart = placeholderEnd; placeholderStart++; continue; } String placeholder = placeholderText.substring(placeholderStart, placeholderEnd + 1); if (!isValidPlaceholder(placeholder)) { placeholders.put(placeholderStart, placeholder); } placeholderStart = placeholderEnd; placeholderStart++; } return placeholders; }</code><technical_language>StringUtil#containsChar</technical_language>

Target:
private static LinkedHashMap<Integer, String> getPlaceholders(@Nullable GoExpression argument) { LinkedHashMap<Integer, String> placeholders = new LinkedHashMap<Integer, String>(); if (argument == null) return placeholders; String placeholderText = resolve(argument); if (placeholderText == null) return placeholders; if (StringUtil.countChars(placeholderText, '%') < 2) return placeholders; if (StringUtil.countChars(placeholderText, '%') == 2 && placeholderText.contains("%%")) return placeholders; int placeholderTextLength = placeholderText.length(); int placeholderStart = 0; String PLACEHOLDER_ALLOWED_CHARS = " *#.[]+-0123456789"; String PLACEHOLDER_END_CHARS = "%vTtbcdoqxXUbeEfFgGsqxXp"; while (placeholderStart < placeholderTextLength) { ProgressManager.checkCanceled(); char PLACEHOLDER_START_CHAR = '%'; if (PLACEHOLDER_START_CHAR != placeholderText.charAt(placeholderStart)) { placeholderStart++; continue; } int placeholderEnd = placeholderStart + 1; while (placeholderEnd < placeholderTextLength && StringUtil.containsChar(PLACEHOLDER_ALLOWED_CHARS, placeholderText.charAt(placeholderEnd)) && StringUtil.containsChar(PLACEHOLDER_END_CHARS, placeholderText.charAt(placeholderEnd))) { placeholderEnd++; } if (placeholderEnd >= placeholderTextLength) break; if (PLACEHOLDER_ALLOWED_CHARS.indexOf(placeholderText.charAt(placeholderEnd)) == -1 && PLACEHOLDER_END_CHARS.indexOf(placeholderText.charAt(placeholderEnd)) == -1) { placeholderStart = placeholderEnd; placeholderStart++; continue; } String placeholder = placeholderText.substring(placeholderStart, placeholderEnd + 1); if (!"%%".equals(placeholder)) { placeholders.put(placeholderStart, placeholder); } placeholderStart = placeholderEnd; placeholderStart++; } return placeholders; }