Examples of ProblemReporter


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

  * 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

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

* Note that as a side-effect, this updates the current reference context
* (unit, type or method) in case the problem handler decides it is necessary
* to abort.
*/
public ProblemReporter problemReporter() {
  ProblemReporter problemReporter = this.referenceContext.problemReporter;
  problemReporter.referenceContext = this.referenceContext;
  return problemReporter;
}
View Full Code Here

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

    this.nameEnvironment = nameEnvironment;
    this.typeCache = new HashtableOfObject(5);
    this.openedBinaryTypes = 0;

    this.problemFactory = new CompletionProblemFactory(Locale.getDefault());
    this.problemReporter = new ProblemReporter(
        DefaultErrorHandlingPolicies.proceedWithAllProblems(),
        this.compilerOptions,
        this.problemFactory);
    this.lookupEnvironment =
      new LookupEnvironment(this, this.compilerOptions, this.problemReporter, nameEnvironment);
View Full Code Here

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

    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

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

  }
  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

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

  public EcjTreeBuilder(String rawInput, String name, CompilerOptions options) {
    this(rawInput, createDefaultProblemReporter(options), createSilentProblemReporter(options), new CompilationResult(name.toCharArray(), 0, 0, 0));
  }
 
  private static ProblemReporter createDefaultProblemReporter(CompilerOptions options) {
    return new ProblemReporter(new IErrorHandlingPolicy() {
      public boolean proceedOnErrors() {
        return true;
      }
     
      public boolean stopOnFirstError() {
View Full Code Here

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

      }
    }, options, new DefaultProblemFactory(Locale.ENGLISH));
  }
 
  private static ProblemReporter createSilentProblemReporter(CompilerOptions options) {
    return new ProblemReporter(new IErrorHandlingPolicy() {
      public boolean proceedOnErrors() {
        return true;
      }
     
      public boolean stopOnFirstError() {
View Full Code Here

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

    }

    private Parser getParser() {
        if (mParser == null) {
            CompilerOptions options = createCompilerOptions();
            ProblemReporter problemReporter = new ProblemReporter(
                    DefaultErrorHandlingPolicies.exitOnFirstError(),
                    options,
                    new DefaultProblemFactory());
            mParser = new Parser(problemReporter,
                    options.parseLiteralExpressionsAsConstants);
View Full Code Here

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

        return cu;
    }

    private static Parser createCommentRecorderParser(CompilerOptions options) {
        Parser parser =
                new CommentRecorderParser(new ProblemReporter(
                        DefaultErrorHandlingPolicies.proceedWithAllProblems(),
                        options,
                        new DefaultProblemFactory()), false);
        return parser;
    }
View Full Code Here

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

        options.targetJDK = ClassFileConstants.JDK1_6;
        return options;
    }

    private static Parser createCommentRecorderParser(CompilerOptions options) {
        return new CommentRecorderParser(new ProblemReporter(
                DefaultErrorHandlingPolicies.proceedWithAllProblems(),
                options,
                new DefaultProblemFactory()), false);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.