private static void processJavacMessages(final List<String> javacMessages, final AntBuildMessageView messageView, final Project project) {
    if (javacMessages == null) {
      return;
    }

    final com.intellij.compiler.OutputParser outputParser = new JavacOutputParser(project);

    com.intellij.compiler.OutputParser.Callback callback = new com.intellij.compiler.OutputParser.Callback() {
      private int myIndex = -1;

      @Override
      @Nullable
      public String getCurrentLine() {
        if (myIndex >= javacMessages.size()) {
          return null;
        }
        return javacMessages.get(myIndex);
      }

      @Override
      public String getNextLine() {
        final int size = javacMessages.size();
        final int next = Math.min(myIndex + 1, javacMessages.size());
        myIndex = next;
        if (next >= size) {
          return null;
        }
        return javacMessages.get(next);
      }

      @Override
      public void pushBack(String line) {
        myIndex--;
      }

      @Override
      public void message(final CompilerMessageCategory category,
                          final String message,
                          final String url,
                          final int lineNum,
                          final int columnNum) {
        StringTokenizer tokenizer = new StringTokenizer(message, "\n", false);
        final String[] strings = new String[tokenizer.countTokens()];
        for (int idx = 0; tokenizer.hasMoreTokens(); idx++) {
          strings[idx] = tokenizer.nextToken();
        }
        ApplicationManager.getApplication().runReadAction(() -> {
          VirtualFile file = url == null ? null : VirtualFileManager.getInstance().findFileByUrl(url);
          messageView.outputJavacMessage(convertCategory(category), strings, file, url, lineNum, columnNum);

          if (file != null && category == CompilerMessageCategory.ERROR) {
            final WolfTheProblemSolver wolf = WolfTheProblemSolver.getInstance(project);
            final Problem problem = wolf.convertToProblem(file, lineNum, columnNum, strings);
            wolf.weHaveGotNonIgnorableProblems(file, Collections.singletonList(problem));
          }
        });
      }

      @Override
      public void setProgressText(String text) {
      }

      @Override
      public void fileProcessed(String path) {
      }

      @Override
      public void fileGenerated(String path) {
      }
    };
    try {
      while (true) {
        if (!outputParser.processMessageLine(callback)) {
          break;
        }
      }
    }
    catch (Exception e) {
      //ignore
    }
  }
private static void processJavacMessages(final List<String> javacMessages, final AntBuildMessageView messageView, final Project project)