Package com.google.errorprone

Examples of com.google.errorprone.ErrorProneScanner$EnabledPredicate


  @Before
  public void setUp() {
    diagnosticHelper = new DiagnosticTestHelper();
    compiler = new ErrorProneTestCompiler.Builder()
        .listenToDiagnostics(diagnosticHelper.collector)
        .report(new ErrorProneScanner(new MyChecker()))
        .build();
  }
View Full Code Here


  private ErrorProneTestCompiler compiler;

  @Before
  public void setUp() {
    compiler = new ErrorProneTestCompiler.Builder()
        .report(new ErrorProneScanner(new EnabledPredicate() {
          @Override
          public boolean isEnabled(Class<? extends BugChecker> check, BugPattern annotation) {
            return asList(DeadException.class, EmptyIfStatement.class, SelfAssignment.class)
                .contains(check);
          }
View Full Code Here

  @Before
  public void setUp() {
    diagnosticHelper = new DiagnosticTestHelper();
    compiler = new ErrorProneTestCompiler.Builder()
        .listenToDiagnostics(diagnosticHelper.collector)
        .report(new ErrorProneScanner(new MyChecker(), new MyChecker2()))
        .build();
  }
View Full Code Here

  public Class<? extends Annotation> getCustomSuppressionAnnotation() {
    return customSuppressionAnnotation;
  }

  public final Scanner createScanner() {
    return new ErrorProneScanner(this);
  }
View Full Code Here

    ErrorProneOptions errorProneOptions = ErrorProneOptions.processArgs(ArrayUtil.toStringArray(ContainerUtil.toCollection(options)));
    List<String> remainingOptions = Arrays.asList(errorProneOptions.getRemainingArgs());
    CompilationTask task = myJavacTool.getTask(out, fileManager, diagnosticListener, remainingOptions, classes, compilationUnits);
    Context context = ((JavacTaskImpl)task).getContext();
    try {
      ErrorProneScanner scanner = new ErrorProneScanner(ErrorProneScanner.EnabledPredicate.DEFAULT_CHECKS);
      Method setDisabledChecks = ErrorProneScanner.class.getDeclaredMethod("setDisabledChecks", Set.class);
      setDisabledChecks.setAccessible(true);
      setDisabledChecks.invoke(scanner, errorProneOptions.getDisabledChecks());
      context.put(Scanner.class, scanner);
    }
View Full Code Here

TOP

Related Classes of com.google.errorprone.ErrorProneScanner$EnabledPredicate

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.