boolean (Callback callback) { if (super.processMessageLine(callback)) { return true; } final String line = callback.getCurrentLine(); if (line == null) { return false; } if (JavacResourcesReader.MSG_PATTERNS_START.equals(line)) { myParserActions.clear(); while (true) { final String patternLine = callback.getNextLine(); if (JavacResourcesReader.MSG_PATTERNS_END.equals(patternLine)) { break; } addJavacPattern(patternLine); } return true; } int colonIndex1 = line.indexOf(':'); if (colonIndex1 == 1){ // drive letter colonIndex1 = line.indexOf(':', colonIndex1 + 1); } if (colonIndex1 >= 0){ // looks like found something like file path @NonNls String part1 = line.substring(0, colonIndex1).trim(); if(part1.equalsIgnoreCase("error") /*jikes*/ || part1.equalsIgnoreCase("Caused by")) { addMessage(callback, CompilerMessageCategory.ERROR, line.substring(colonIndex1)); return true; } if(part1.equalsIgnoreCase("warning")) { addMessage(callback, CompilerMessageCategory.WARNING, line.substring(colonIndex1)); return true; } if(part1.equals("javac")) { addMessage(callback, CompilerMessageCategory.ERROR, line); return true; } final int colonIndex2 = line.indexOf(':', colonIndex1 + 1); if (colonIndex2 >= 0){ final String filePath = part1.replace(File.separatorChar, '/'); final Boolean fileExists = ReadAction.compute(() -> LocalFileSystem.getInstance().findFileByPath(filePath) != null); if (!fileExists.booleanValue()) { // the part one turned out to be something else than a file path return true; } try { final int lineNum = Integer.parseInt(line.substring(colonIndex1 + 1, colonIndex2).trim()); String message = line.substring(colonIndex2 + 1).trim(); CompilerMessageCategory category = CompilerMessageCategory.ERROR; if (message.startsWith(WARNING_PREFIX)){ message = message.substring(WARNING_PREFIX.length()).trim(); category = CompilerMessageCategory.WARNING; } List<String> messages = new ArrayList<>(); messages.add(message); int colNum; String prevLine = null; do{ final String nextLine = callback.getNextLine(); if (nextLine == null) { return false; } if (nextLine.trim().equals("^")){ final CharSequence chars = prevLine == null ? line : prevLine; final int offset = Math.max(0, Math.min(chars.length(), nextLine.indexOf('^'))); colNum = EditorUtil.calcColumnNumber(null, chars,0, offset, myTabSize); String messageEnd = callback.getNextLine(); while (isMessageEnd(messageEnd)) { messages.add(messageEnd.trim()); messageEnd = callback.getNextLine(); } if (messageEnd != null) { callback.pushBack(messageEnd); } break; } if (prevLine != null) { messages.add(prevLine); } prevLine = nextLine; } while(true); if (colNum >= 0){ convertMessages(messages); String text = StringUtil.join(messages, "\n"); addMessage(callback, category, text, VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, filePath), lineNum, colNum + 1); return true; } } catch (NumberFormatException ignored) { } } } if(line.endsWith("java.lang.OutOfMemoryError")) { addMessage(callback, CompilerMessageCategory.ERROR, JavaCompilerBundle.message("error.javac.out.of.memory")); return true; } addMessage(callback, CompilerMessageCategory.INFORMATION, line); return true; }