private static @Nls String createStatusMessage(final ExitStatus status, final int warningCount, final int errorCount, long duration) {
    String message;
    if (status == ExitStatus.CANCELLED) {
      message = JavaCompilerBundle.message("status.compilation.aborted");
    }
    else if (status == ExitStatus.UP_TO_DATE) {
      message = JavaCompilerBundle.message("status.all.up.to.date");
    }
    else {
      String durationString = NlsMessages.formatDurationApproximate(duration);
      if (status == ExitStatus.SUCCESS) {
        message = warningCount > 0
                  ? JavaCompilerBundle.message("status.compilation.completed.successfully.with.warnings", warningCount, durationString)
                  : JavaCompilerBundle.message("status.compilation.completed.successfully", durationString);
      }
      else {
        message = JavaCompilerBundle.message("status.compilation.completed.successfully.with.warnings.and.errors",
                                             errorCount, warningCount, durationString);
      }
    }
    return message;
  }
private static @Nls String createStatusMessage(final ExitStatus status, final int warningCount, final int errorCount, long duration)