int (String text, int start, int end) { int paragraphStart = text.lastIndexOf("\n\n", start); int paragraphEnd = text.indexOf("\n\n", end); if (paragraphStart >= paragraphEnd) { return text.length(); } return (paragraphStart >= 0 ? paragraphStart + 2 : 0) + (<warning descr="Condition 'paragraphEnd < 0' is always 'false' when reached">paragraphEnd < 0</warning> ? text.length() : paragraphEnd); }