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

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


ProblemReporter problemReporter() {
  return this.type.scope.problemReporter();
}

ProblemReporter problemReporter(MethodBinding currentMethod) {
  ProblemReporter reporter = problemReporter();
  if (currentMethod.declaringClass == this.type && currentMethod.sourceMethod() != null// only report against the currentMethod if its implemented by the type
    reporter.referenceContext = currentMethod.sourceMethod();
  return reporter;
}
View Full Code Here


  }
  return null;
}

public void checkTypeArgumentRedundancy(ParameterizedTypeBinding allocationType, ReferenceBinding enclosingType, TypeBinding[] argumentTypes, final BlockScope scope) {
  ProblemReporter reporter = scope.problemReporter();
  if ((reporter.computeSeverity(IProblem.RedundantSpecificationOfTypeArguments) == ProblemSeverities.Ignore) || scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_7) return;
  if (allocationType.arguments == null) return// raw binding
  if (this.genericTypeArguments != null) return; // diamond can't occur with explicit type args for constructor
  if (argumentTypes == Binding.NO_PARAMETERS && this.typeExpected instanceof ParameterizedTypeBinding) {
    ParameterizedTypeBinding expected = (ParameterizedTypeBinding) this.typeExpected;
    if (expected.arguments != null && allocationType.arguments.length == expected.arguments.length) {
      // check the case when no ctor takes no params and inference uses the expected type directly
      // eg. X<String> x = new X<String>()
      int i;
      for (i = 0; i < allocationType.arguments.length; i++) {
        if (allocationType.arguments[i] != expected.arguments[i])
          break;
      }
      if (i == allocationType.arguments.length) {
        reporter.redundantSpecificationOfTypeArguments(this.type, allocationType.arguments);
        return;
     
    }
  }
  TypeBinding [] inferredTypes = inferElidedTypes(allocationType.genericType(), enclosingType, argumentTypes, scope);
  if (inferredTypes == null) {
    return;
  }
  for (int i = 0; i < inferredTypes.length; i++) {
    if (inferredTypes[i] != allocationType.arguments[i])
      return;
  }
  reporter.redundantSpecificationOfTypeArguments(this.type, allocationType.arguments);
}
View Full Code Here

ProblemReporter problemReporter() {
  return this.type.scope.problemReporter();
}

ProblemReporter problemReporter(MethodBinding currentMethod) {
  ProblemReporter reporter = problemReporter();
  if (currentMethod.declaringClass == this.type && currentMethod.sourceMethod() != null// only report against the currentMethod if its implemented by the type
    reporter.referenceContext = currentMethod.sourceMethod();
  return reporter;
}
View Full Code Here

  * to abort.
  */
  public ProblemReporter problemReporter() {
    MethodScope outerMethodScope;
    if ((outerMethodScope = outerMostMethodScope()) == null) {
      ProblemReporter problemReporter = referenceCompilationUnit().problemReporter;
      problemReporter.referenceContext = this.referenceContext;
      return problemReporter;
    }
    return outerMethodScope.problemReporter();
  }
View Full Code Here

    if (this.javadoc != null) {
      this.javadoc.resolve(initializationScope);
    } else if (this.binding != null && this.binding.declaringClass != null && !this.binding.declaringClass.isLocalType()) {
      // Set javadoc visibility
      int javadocVisibility = this.binding.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;
      ProblemReporter reporter = initializationScope.problemReporter();
      int severity = reporter.computeSeverity(IProblem.JavadocMissing);
      if (severity != ProblemSeverities.Ignore) {
        if (classScope != null) {
          javadocVisibility = Util.computeOuterMostVisibility(classScope.referenceType(), javadocVisibility);
        }
        int javadocModifiers = (this.binding.modifiers & ~ExtraCompilerModifiers.AccVisibilityMASK) | javadocVisibility;
        reporter.javadocMissing(this.sourceStart, this.sourceEnd, severity, javadocModifiers);
      }
    }
  } finally {
    initializationScope.initializedField = previousField;
    initializationScope.lastVisibleFieldID = previousFieldID;
View Full Code Here

    if (source == null) {
      throw new IllegalArgumentException();
    }
    CompilerOptions compilerOptions = new CompilerOptions(settings);
    compilerOptions.ignoreMethodBodies = this.ignoreMethodBodies;
    final ProblemReporter problemReporter = new ProblemReporter(
          DefaultErrorHandlingPolicies.proceedWithAllProblems(),
          compilerOptions,
          new DefaultProblemFactory(Locale.getDefault()));

    CommentRecorderParser parser = new CommentRecorderParser(problemReporter, false);
View Full Code Here

    }
    CompilerOptions compilerOptions = new CompilerOptions(settings);
    compilerOptions.ignoreMethodBodies = this.ignoreMethodBodies;
    CommentRecorderParser parser =
      new CommentRecorderParser(
        new ProblemReporter(
          DefaultErrorHandlingPolicies.proceedWithAllProblems(),
          compilerOptions,
          new DefaultProblemFactory(Locale.getDefault())),
      false);
View Full Code Here

    if (source == null) {
      throw new IllegalArgumentException();
    }
    CompilerOptions compilerOptions = new CompilerOptions(settings);
    // in this case we don't want to ignore method bodies since we are parsing only an expression
    final ProblemReporter problemReporter = new ProblemReporter(
          DefaultErrorHandlingPolicies.proceedWithAllProblems(),
          compilerOptions,
          new DefaultProblemFactory(Locale.getDefault()));

    CommentRecorderParser parser = new CommentRecorderParser(problemReporter, false);
View Full Code Here

    if (source == null) {
      throw new IllegalArgumentException();
    }
    CompilerOptions compilerOptions = new CompilerOptions(settings);
    // in this case we don't want to ignore method bodies since we are parsing only statements
    final ProblemReporter problemReporter = new ProblemReporter(
          DefaultErrorHandlingPolicies.proceedWithAllProblems(),
          compilerOptions,
          new DefaultProblemFactory(Locale.getDefault()));
    CommentRecorderParser parser = new CommentRecorderParser(problemReporter, false);
    parser.setMethodsFullRecovery(false);
View Full Code Here

  * to abort.
  */
  public ProblemReporter problemReporter() {
    MethodScope outerMethodScope;
    if ((outerMethodScope = outerMostMethodScope()) == null) {
      ProblemReporter problemReporter = referenceCompilationUnit().problemReporter;
      problemReporter.referenceContext = this.referenceContext;
      return problemReporter;
    }
    return outerMethodScope.problemReporter();
  }
View Full Code Here

TOP

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

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.