Package org.eclipse.jdt.core.compiler

Examples of org.eclipse.jdt.core.compiler.CategorizedProblem


      if (count != 0) {
        int errors = 0;
        int warnings = 0;
        int tasks = 0;
        for (int i = 0; i < count; i++) {
          CategorizedProblem problem = problems[i];
          if (problem != null) {
            currentMain.globalProblemsCount++;
            logProblem(problem, localProblemCount, currentMain.globalProblemsCount, unitSource);
            localProblemCount++;
            if (problem.isError()) {
              localErrorCount++;
              errors++;
              currentMain.globalErrorsCount++;
            } else if (problem.getID() == IProblem.Task) {
              currentMain.globalTasksCount++;
              tasks++;
            } else {
              currentMain.globalWarningsCount++;
              warnings++;
            }
          }
        }
        if ((this.tagBits & Logger.XML) != 0) {
          if ((errors + warnings) != 0) {
            startLoggingProblems(errors, warnings);
            for (int i = 0; i < count; i++) {
              CategorizedProblem problem = problems[i];
              if (problem!= null) {
                if (problem.getID() != IProblem.Task) {
                  logXmlProblem(problem, unitSource);
                }
              }
            }
            endLoggingProblems();
          }
          if (tasks != 0) {
            startLoggingTasks(tasks);
            for (int i = 0; i < count; i++) {
              CategorizedProblem problem = problems[i];
              if (problem!= null) {
                if (problem.getID() == IProblem.Task) {
                  logXmlTask(problem, unitSource);
                }
              }
            }
            endLoggingTasks();
View Full Code Here


        end = methodDeclaration.bodyEnd;
        // try to get the best end position
        CategorizedProblem[] problems = methodDeclaration.compilationResult().problems;
        if (problems != null) {
          for (int i = 0, max = methodDeclaration.compilationResult().problemCount; i < max; i++) {
            CategorizedProblem currentProblem = problems[i];
            if (currentProblem.getSourceStart() == start && currentProblem.getID() == IProblem.ParsingErrorInsertToComplete) {
              end = currentProblem.getSourceEnd();
              break;
            }
          }
        }
        int startPosition = methodDecl.getStartPosition();
View Full Code Here

      int localProblemCount = 0;
      if (count != 0) {
        int errors = 0;
        int warnings = 0;
        for (int i = 0; i < count; i++) {
          CategorizedProblem problem = (CategorizedProblem) problems.get(i);
          if (problem != null) {
            currentMain.globalProblemsCount++;
            logExtraProblem(problem, localProblemCount, currentMain.globalProblemsCount);
            localProblemCount++;
            if (problem.isError()) {
              errors++;
              currentMain.globalErrorsCount++;
            } else if (problem.isWarning()) {
              currentMain.globalWarningsCount++;
              warnings++;
            }
          }
        }
        if ((this.tagBits & Logger.XML) != 0) {
          if ((errors + warnings) != 0) {
            startLoggingExtraProblems(count);
            for (int i = 0; i < count; i++) {
              CategorizedProblem problem = (CategorizedProblem) problems.get(i);
              if (problem!= null) {
                if (problem.getID() != IProblem.Task) {
                  logXmlExtraProblem(problem, localProblemCount, currentMain.globalProblemsCount);
                }
              }
            }
            endLoggingExtraProblems();
View Full Code Here

      if (count != 0) {
        int errors = 0;
        int warnings = 0;
        int tasks = 0;
        for (int i = 0; i < count; i++) {
          CategorizedProblem problem = problems[i];
          if (problem != null) {
            currentMain.globalProblemsCount++;
            logProblem(problem, localProblemCount, currentMain.globalProblemsCount, unitSource);
            localProblemCount++;
            if (problem.isError()) {
              localErrorCount++;
              errors++;
              currentMain.globalErrorsCount++;
            } else if (problem.getID() == IProblem.Task) {
              currentMain.globalTasksCount++;
              tasks++;
            } else {
              currentMain.globalWarningsCount++;
              warnings++;
            }
          }
        }
        if ((this.tagBits & Logger.XML) != 0) {
          if ((errors + warnings) != 0) {
            startLoggingProblems(errors, warnings);
            for (int i = 0; i < count; i++) {
              CategorizedProblem problem = problems[i];
              if (problem!= null) {
                if (problem.getID() != IProblem.Task) {
                  logXmlProblem(problem, unitSource);
                }
              }
            }
            endLoggingProblems();
          }
          if (tasks != 0) {
            startLoggingTasks(tasks);
            for (int i = 0; i < count; i++) {
              CategorizedProblem problem = problems[i];
              if (problem!= null) {
                if (problem.getID() == IProblem.Task) {
                  logXmlTask(problem, unitSource);
                }
              }
            }
            endLoggingTasks();
View Full Code Here

      problemRequestor.beginReporting();
      for (Iterator iteraror = this.problems.values().iterator(); iteraror.hasNext();) {
        CategorizedProblem[] categorizedProblems = (CategorizedProblem[]) iteraror.next();
        if (categorizedProblems == null) continue;
        for (int i = 0, length = categorizedProblems.length; i < length; i++) {
          CategorizedProblem problem = categorizedProblems[i];
          if (JavaModelManager.VERBOSE){
            System.out.println("PROBLEM FOUND while reconciling : " + problem.getMessage());//$NON-NLS-1$
          }
          if (this.progressMonitor != null && this.progressMonitor.isCanceled()) break;
          problemRequestor.acceptProblem(problem);
        }
      }
View Full Code Here

  }

  private boolean markIncludedProblems(int start, int end) {
    boolean foundProblems = false;
    next: for (int i = 0, max = this.problems.length; i < max; i++) {
      CategorizedProblem problem = this.problems[i];

      if(this.usedOrIrrelevantProblems[i]) continue next;

      switch(problem.getID()) {
        case IProblem.ParsingErrorOnKeywordNoSuggestion :
        case IProblem.ParsingErrorOnKeyword :
        case IProblem.ParsingError :
        case IProblem.ParsingErrorNoSuggestion :
        case IProblem.ParsingErrorInsertTokenBefore :
        case IProblem.ParsingErrorInsertTokenAfter :
        case IProblem.ParsingErrorDeleteToken :
        case IProblem.ParsingErrorDeleteTokens :
        case IProblem.ParsingErrorMergeTokens :
        case IProblem.ParsingErrorInvalidToken :
        case IProblem.ParsingErrorMisplacedConstruct :
        case IProblem.ParsingErrorReplaceTokens :
        case IProblem.ParsingErrorNoSuggestionForTokens :
        case IProblem.ParsingErrorUnexpectedEOF :
        case IProblem.ParsingErrorInsertToComplete :
        case IProblem.ParsingErrorInsertToCompleteScope :
        case IProblem.ParsingErrorInsertToCompletePhrase :
        case IProblem.EndOfSource :
        case IProblem.InvalidHexa :
        case IProblem.InvalidOctal :
        case IProblem.InvalidCharacterConstant :
        case IProblem.InvalidEscape :
        case IProblem.InvalidInput :
        case IProblem.InvalidUnicodeEscape :
        case IProblem.InvalidFloat :
        case IProblem.NullSourceString :
        case IProblem.UnterminatedString :
        case IProblem.UnterminatedComment :
        case IProblem.InvalidDigit :
          break;
        default:
          this.usedOrIrrelevantProblems[i] = true;
          continue next;

      }

      int problemStart = problem.getSourceStart();
      int problemEnd = problem.getSourceEnd();
      if ((start <= problemStart) && (problemStart <= end) ||
          (start <= problemEnd) && (problemEnd <= end)) {
        this.usedOrIrrelevantProblems[i] = true;
        foundProblems = true;
      }
View Full Code Here

  CategorizedProblem[] allProblems = new CategorizedProblem[totalNumberOfProblem];
  int allProblemIndex = 0;
  int taskIndex = 0;
  int problemIndex = 0;
  while (taskIndex + problemIndex < totalNumberOfProblem) {
    CategorizedProblem nextTask = null;
    CategorizedProblem nextProblem = null;
    if (taskIndex < onlyTaskCount) {
      nextTask = onlyTasks[taskIndex];
    }
    if (problemIndex < onlyProblemCount) {
      nextProblem = onlyProblems[problemIndex];
    }
    // select the next problem
    CategorizedProblem currentProblem = null;
    if (nextProblem != null) {
      if (nextTask != null) {
        if (nextProblem.getSourceStart() < nextTask.getSourceStart()) {
          currentProblem = nextProblem;
          problemIndex++;
View Full Code Here

  // Re-adjust the size of the problems if necessary and filter package problems
  if (this.problems != null) {
    CategorizedProblem[] filteredProblems = new CategorizedProblem[this.problemCount];
    int keep = 0;
    for (int i=0; i< this.problemCount; i++) {
      CategorizedProblem problem = this.problems[i];
      if (problem.getID() != IProblem.MissingNonNullByDefaultAnnotationOnPackage) {
        filteredProblems[keep++] = problem;
      } else if (this.compilationUnit != null) {
        if (CharOperation.equals(this.compilationUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) {
          filteredProblems[keep++] = problem;
        }
View Full Code Here

    while (computePriority(problemList[right]) < mid)
      right--;
    while (mid < computePriority(problemList[left]))
      left++;
    if (left <= right) {
      CategorizedProblem tmp = problemList[left];
      problemList[left] = problemList[right];
      problemList[right] = tmp;
      left++;
      right--;
    }
View Full Code Here

  }

  // if no reference context, we need to abort from the current compilation process
  if (referenceContext == null) {
    if ((severity & ProblemSeverities.Error) != 0) { // non reportable error is fatal
      CategorizedProblem problem = this.createProblem(null, problemId, problemArguments, elaborationId, messageArguments, severity, 0, 0, 0, 0);
      throw new AbortCompilation(null, problem);
    } else {
      return; // ignore non reportable warning
    }
  }

  int[] lineEnds;
  int lineNumber = problemStartPosition >= 0
      ? Util.getLineNumber(problemStartPosition, lineEnds = unitResult.getLineSeparatorPositions(), 0, lineEnds.length-1)
      : 0;
  int columnNumber = problemStartPosition >= 0
      ? Util.searchColumnNumber(unitResult.getLineSeparatorPositions(), lineNumber, problemStartPosition)
      : 0;
  CategorizedProblem problem =
    this.createProblem(
      unitResult.getFileName(),
      problemId,
      problemArguments,
      elaborationId,
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.compiler.CategorizedProblem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.