Package org.aspectj.org.eclipse.jdt.core.compiler

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


public void discardSuppressedWarnings() {
  if (this.suppressWarningsCount == 0) return;
  int removed = 0;
  nextProblem: for (int i = 0, length = this.problemCount; i < length; i++) {
    CategorizedProblem problem = this.problems[i];
    int problemID = problem.getID();
    if (!problem.isWarning()) {
      continue nextProblem;
    }
    int start = problem.getSourceStart();
    int end = problem.getSourceEnd();
    nextSuppress: for (int j = 0, max = this.suppressWarningsCount; j < max; j++) {
      long position = this.suppressWarningScopePositions[j];
      int startSuppress = (int) (position >>> 32);
      int endSuppress = (int) position;
      if (start < startSuppress) continue nextSuppress;
      if (end > endSuppress) continue nextSuppress;
      if ((ProblemReporter.getIrritant(problemID) & this.suppressWarningIrritants[j]) == 0)
        continue nextSuppress;
      // discard suppressed warning
      removed++;
      this.problems[i] = null;
      if (this.problemsMap != null) this.problemsMap.remove(problem);
      if (this.firstErrors != null) this.firstErrors.remove(problem);
      continue nextProblem;
    }
  }
  if (removed > 0) {
    for (int i = 0, index = 0; i < this.problemCount; i++) {
      CategorizedProblem problem;
      if ((problem = this.problems[i]) != null) {
        if (i > index) {
          this.problems[index++] = problem;
        } else {
          index++;
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

        removed++;
      }
    }
    if (removed > 0) {
      for (int i = 0, index = 0; i < this.problemCount; i++) {
        CategorizedProblem problem;
        if ((problem = this.problems[i]) != null) {
          if (i > index) {
            this.problems[index++] = problem;
          } else {
            index++;
View Full Code Here

        filename = sLoc.getSourceFile().getPath().toCharArray();
        usedBinarySourceFileName = true;
      }
    }
    ReferenceContext referenceContext = findReferenceContextFor(problemSource);
    CategorizedProblem problem = compiler.problemReporter.createProblem(filename, IProblem.Unclassified, new String[0],
        new String[] { message.getMessage() }, severity, startPos, endPos, sLoc != null ? sLoc.getLine() : 0,
        sLoc != null ? sLoc.getColumn() : 0);
    IProblem[] seeAlso = buildSeeAlsoProblems(problem, message.getExtraSourceLocations(), problemSource,
        usedBinarySourceFileName);
    problem.setSeeAlsoProblems(seeAlso);

    StringBuffer details = new StringBuffer();
    // Stick more info in supplementary message info
    if (message.getDetails() != null) {
      details.append(message.getDetails());
    }
    // Remember if this message was due to a deow
    if (message.getDeclared()) {
      details.append("[deow=true]");
    }
    if (message instanceof LintMessage) {
      String lintMessageName = ((LintMessage) message).getLintKind();
      details.append("[Xlint:").append(lintMessageName).append("]");
    }
    if (details.length() != 0) {
      problem.setSupplementaryMessageInfo(details.toString());
    }
    compiler.problemReporter.record(problem, problemSource, referenceContext);
    return true;
  }
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

    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

*/
public void signalError(int start, int end, String msg) {
  CompilationResult unitResult = referenceContext.compilationResult();
  int lineNumber = start >= 0?Util.getLineNumber(start,unitResult.lineSeparatorPositions, 0, unitResult.lineSeparatorPositions.length-1):0;
  int columnNumber = start >= 0?Util.searchColumnNumber(unitResult.getLineSeparatorPositions(), lineNumber, start): 0;
  CategorizedProblem problem =
    new DefaultProblem(unitResult.getFileName(), msg,
            IProblem.ParsingError,  //??? would like IProblem.Unknown
                    new String[0], ProblemSeverities.Error,
                    start, end,
                    lineNumber,columnNumber);
View Full Code Here

TOP

Related Classes of org.aspectj.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.