Package org.eclipse.jdt.core.compiler

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


    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


  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

    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 (problems != null) {
      int max = problems.length;
      StringBuffer buffer = new StringBuffer(25);
      int count = 0;
      for (int i = 0; i < max; i++) {
        CategorizedProblem problem = problems[i];
        if ((problem != null) && (problem.isError())) {
          buffer.append("\t"  +problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
          count++;
          if (problemLine == 0) {
            problemLine = problem.getSourceLineNumber();
          }
          problems[i] = null;
        }
      } // insert the top line afterwards, once knowing how many problems we have to consider
      if (count > 1) {
View Full Code Here

    if (problems != null) {
      int max = problems.length;
      StringBuffer buffer = new StringBuffer(25);
      int count = 0;
      for (int i = 0; i < max; i++) {
        CategorizedProblem problem = problems[i];
        if ((problem != null) && (problem.isError())) {
          buffer.append("\t"  +problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
          count++;
          if (problemLine == 0) {
            problemLine = problem.getSourceLineNumber();
          }
        }
      } // insert the top line afterwards, once knowing how many problems we have to consider
      if (count > 1) {
        buffer.insert(0, Messages.compilation_unresolvedProblems);
View Full Code Here

    if (problems != null) {
      int max = problems.length;
      StringBuffer buffer = new StringBuffer(25);
      int count = 0;
      for (int i = 0; i < max; i++) {
        CategorizedProblem problem = problems[i];
        if ((problem != null)
          && (problem.isError())
          && (problem.getSourceStart() >= method.declarationSourceStart)
          && (problem.getSourceEnd() <= method.declarationSourceEnd)) {
          buffer.append("\t"  +problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
          count++;
          if (problemLine == 0) {
            problemLine = problem.getSourceLineNumber();
          }
          problems[i] = null;
        }
      } // insert the top line afterwards, once knowing how many problems we have to consider
      if (count > 1) {
View Full Code Here

        MethodBinding methodBinding = methodDeclaration.binding;
         String readableName = new String(methodBinding.readableName());
         CategorizedProblem[] problems = compilationResult.problems;
         int problemsCount = compilationResult.problemCount;
        for (int j = 0; j < problemsCount; j++) {
          CategorizedProblem problem = problems[j];
          if (problem != null
              && problem.getID() == IProblem.AbstractMethodMustBeImplemented
              && problem.getMessage().indexOf(readableName) != -1
              && problem.getSourceStart() >= typeDeclarationSourceStart
              && problem.getSourceEnd() <= typeDeclarationSourceEnd) {
            // we found a match
            addMissingAbstractProblemMethod(methodDeclaration, methodBinding, problem, compilationResult);
          }
        }
      }
View Full Code Here

  int problemCount = this.compilationResult.problemCount;
  IrritantSet[] foundIrritants = new IrritantSet[this.suppressWarningsCount];
  CompilerOptions options = this.scope.compilerOptions();
  boolean hasErrors = false;
  nextProblem: for (int iProblem = 0, length = problemCount; iProblem < length; iProblem++) {
    CategorizedProblem problem = problems[iProblem];
    int problemID = problem.getID();
    if (problem.isError()) {
      if (problemID != IProblem.UnusedWarningToken) {
      // tolerate unused warning tokens which were promoted as errors
        hasErrors = true;
      }
      continue;
    }
    int start = problem.getSourceStart();
    int end = problem.getSourceEnd();
    int irritant = ProblemReporter.getIrritant(problemID);
    nextSuppress: for (int iSuppress = 0, suppressCount = this.suppressWarningsCount; iSuppress < suppressCount; iSuppress++) {
      long position = this.suppressWarningScopePositions[iSuppress];
      int startSuppress = (int) (position >>> 32);
      int endSuppress = (int) position;
      if (start < startSuppress) continue nextSuppress;
      if (end > endSuppress) continue nextSuppress;
      if (!this.suppressWarningIrritants[iSuppress].isSet(irritant))
        continue nextSuppress;
      // discard suppressed warning
      removed++;
      problems[iProblem] = null;
      if (this.compilationResult.problemsMap != null) this.compilationResult.problemsMap.remove(problem);
      if (this.compilationResult.firstErrors != null) this.compilationResult.firstErrors.remove(problem);
      if (foundIrritants[iSuppress] == null){
        foundIrritants[iSuppress] = new IrritantSet(irritant);
      } else {
        foundIrritants[iSuppress].set(irritant);
      }
      continue nextProblem;
    }
  }
  // compact remaining problems
  if (removed > 0) {
    for (int i = 0, index = 0; i < problemCount; i++) {
      CategorizedProblem problem;
      if ((problem = problems[i]) != null) {
        if (i > index) {
          problems[index++] = problem;
        } else {
          index++;
View Full Code Here

  public void printMessage(Kind kind, CharSequence msg, Element e,
      AnnotationMirror a, AnnotationValue v) {
    if (kind == Kind.ERROR) {
      _processingEnv.setErrorRaised(true);
    }
    CategorizedProblem problem = createProblem(kind, msg, e, a, v);
    if (problem != null) {
      this._compiler.addExtraProblems(problem);
    }
  }
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()) {
              localErrorCount++;
              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

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.