Package org.eclipse.jdt.internal.compiler.problem

Examples of org.eclipse.jdt.internal.compiler.problem.DefaultProblem


  }

  public static void reportJsniError(SourceInfo info,
      AbstractMethodDeclaration methodDeclaration, String message) {
    CompilationResult compResult = methodDeclaration.compilationResult();
    DefaultProblem problem = new DefaultProblem(
        info.getFileName().toCharArray(), message, IProblem.Unclassified, null,
        ProblemSeverities.Error, info.getStartPos(), info.getEndPos(),
        info.getStartLine());
    compResult.record(problem, methodDeclaration);
  }
View Full Code Here


    MessageSend messageSend = site.messageSend;
    Scope scope = site.scope;
    CompilationResult compResult = scope.compilationUnitScope().referenceContext().compilationResult();
    int startLine = ProblemHandler.searchLineNumber(
        compResult.lineSeparatorPositions, messageSend.sourceStart());
    DefaultProblem problem = new DefaultProblem(compResult.fileName, message,
        IProblem.Unclassified, null, ProblemSeverities.Error,
        messageSend.sourceStart, messageSend.sourceEnd, startLine);
    compResult.record(problem, scope.referenceContext());
  }
View Full Code Here

        for (int i = 0; i < errorList.length; i++) {
 
          // for (int j = 0; j < errorList[i].length; j++)
          // System.out.print(errorList[i][j] + ", ");
 
          problems[i] = new DefaultProblem((char[]) errorList[i][0],
              (String) errorList[i][1],
              ((Integer) errorList[i][2]).intValue(),
              (String[]) errorList[i][3],
              ((Integer) errorList[i][4]).intValue(),
              ((Integer) errorList[i][5]).intValue(),
View Full Code Here

      for (IType type : unit.getTypes()) {
        for (IMethod method : type.getMethods()) {
          for (IAnnotation a : method.getAnnotations()) {
            if ("FXML".equals(a.getElementName())) { ////$NON-NLS-1$
              if (fxmlMethods.contains(method.getElementName())) {
                DefaultProblem problem = new DefaultProblem(
                    unit.getElementName().toCharArray(),
                    "JavaFX controller method name is not unique: " //$NON-NLS-1$
                        + method.getElementName(),
                    IProblem.ExternalProblemNotFixable,
                    new String[0],
                    ProblemSeverities.Warning, method
                        .getSourceRange().getOffset(),
                    method.getSourceRange().getOffset()
                        + method.getSourceRange()
                            .getLength(),
                    getMethodLineNumber(type, method), 0);
                problems.add(problem);
              }
              fxmlMethods.add(method.getElementName());

              switch (method.getNumberOfParameters()) {
              case 0:
                break;
              case 1: {
                ILocalVariable pType = method.getParameters()[0];
                String[][] resolvedType = type
                    .resolveType(Signature.toString(pType
                        .getTypeSignature()));
                IType parameterType = null;
                if (resolvedType != null) {
                  parameterType = project
                      .findType(resolvedType[0][0]
                          + "." + resolvedType[0][1]); //$NON-NLS-1$
                }
                if (resolvedType == null
                    || !Util.assignable(
                        parameterType,
                        project.findType("javafx.event.Event"))) { ////$NON-NLS-1$
                  DefaultProblem problem = new DefaultProblem(
                      unit.getElementName().toCharArray(),
                      "Parameter '" //$NON-NLS-1$
                          + pType.getElementName()
                          + "' is not assignable to javafx.event.Event", //$NON-NLS-1$
                      IProblem.ExternalProblemNotFixable,
                      new String[0],
                      ProblemSeverities.Warning, pType
                          .getSourceRange()
                          .getOffset(), pType
                          .getSourceRange()
                          .getOffset()
                          + pType.getSourceRange()
                              .getLength(),
                      getMethodLineNumber(type, method),
                      0);
                  problems.add(problem);
                }

              }
                break;
              default: {
                DefaultProblem problem = new DefaultProblem(
                    unit.getElementName().toCharArray(),
                    "JavaFX controller method must have 0 or exactly 1 argument", //$NON-NLS-1$
                    IProblem.ExternalProblemNotFixable,
                    new String[0],
                    ProblemSeverities.Warning, method
View Full Code Here

    CompilationResult compResult = methodDeclaration.compilationResult();
    // recalculate startColumn, because SourceInfo does not hold it
    int startColumn = Util.searchColumnNumber(
        compResult.getLineSeparatorPositions(), info.getStartLine(),
        info.getStartPos());
    DefaultProblem problem = new DefaultProblem(
        info.getFileName().toCharArray(), message,
        IProblem.ExternalProblemNotFixable, null, ProblemSeverities.Error,
        info.getStartPos(), info.getEndPos(), info.getStartLine(), startColumn);
    compResult.record(problem, methodDeclaration);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.problem.DefaultProblem

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.