String (@NotNull CompilerMessage compilerMessage) { String message = null; String[] messages = splitByLines(compilerMessage.getMessage()); if (messages.length > 1) { final String line0 = messages[0]; final String line1 = messages[1]; final int colonIndex = line1.indexOf(':'); if (colonIndex > 0) { String part1 = line1.substring(0, colonIndex).trim(); // extract symbol information from the compiler message of the following template: // java: cannot find symbol // symbol: class AClass // location: class AnotherClass if ("symbol".equals(part1)) { String symbol = line1.substring(colonIndex + 1).trim(); message = line0 + " " + symbol; } } } if (message == null) { message = messages[0]; } return trimEnd(trimStart(message, "java: "), '.'); //NON-NLS }