public static ErrorProneAnalyzer createByScanningForPlugins( ScannerSupplier scannerSupplier, ErrorProneOptions errorProneOptions, Context context) { return new ErrorProneAnalyzer( scansPlugins(scannerSupplier, errorProneOptions, context), errorProneOptions, context, JavacErrorDescriptionListener.provider(context)); }
static ErrorProneAnalyzer createAnalyzer( ScannerSupplier scannerSupplier, ErrorProneOptions epOptions, Context context, RefactoringCollection[] refactoringCollection) { if (!epOptions.patchingOptions().doRefactor()) { return ErrorProneAnalyzer.createByScanningForPlugins(scannerSupplier, epOptions, context); } refactoringCollection[0] = RefactoringCollection.refactor(epOptions.patchingOptions(), context); // Refaster refactorer or using builtin checks CodeTransformer codeTransformer = epOptions .patchingOptions() .customRefactorer() .or( () -> { ScannerSupplier toUse = ErrorPronePlugins.loadPlugins(scannerSupplier, context) .applyOverrides(epOptions); Set<String> namedCheckers = epOptions.patchingOptions().namedCheckers(); if (!namedCheckers.isEmpty()) { toUse = toUse.filter(bci -> namedCheckers.contains(bci.canonicalName())); } return ErrorProneScannerTransformer.create(toUse.get()); }) .get(); return ErrorProneAnalyzer.createWithCustomDescriptionListener( codeTransformer, epOptions, context, refactoringCollection[0]); }
JavaFileObject originalSource = log.useSource(compilation.getSourceFile()); try { if (shouldExcludeSourceFile(compilation)) { return; } else if (finishedCompilation(path.getCompilationUnit())) {
static ErrorProneAnalyzer createWithCustomDescriptionListener( CodeTransformer codeTransformer, ErrorProneOptions errorProneOptions, Context context, DescriptionListener.Factory descriptionListenerFactory) { return new ErrorProneAnalyzer( Suppliers.ofInstance(codeTransformer), errorProneOptions, context, descriptionListenerFactory); }
static ErrorProneAnalyzer createAnalyzer( ScannerSupplier scannerSupplier, ErrorProneOptions epOptions, Context context, RefactoringCollection[] refactoringCollection) { if (!epOptions.patchingOptions().doRefactor()) { return ErrorProneAnalyzer.createByScanningForPlugins(scannerSupplier, epOptions, context); } refactoringCollection[0] = RefactoringCollection.refactor(epOptions.patchingOptions(), context); // Refaster refactorer or using builtin checks CodeTransformer codeTransformer = epOptions .patchingOptions() .customRefactorer() .or( () -> { ScannerSupplier toUse = ErrorPronePlugins.loadPlugins(scannerSupplier, context) .applyOverrides(epOptions); Set<String> namedCheckers = epOptions.patchingOptions().namedCheckers(); if (!namedCheckers.isEmpty()) { toUse = toUse.filter(bci -> namedCheckers.contains(bci.canonicalName())); } return ErrorProneScannerTransformer.create(toUse.get()); }) .get(); return ErrorProneAnalyzer.createWithCustomDescriptionListener( codeTransformer, epOptions, context, refactoringCollection[0]); }
JavaFileObject originalSource = log.useSource(compilation.getSourceFile()); try { if (shouldExcludeSourceFile(compilation.getSourceFile())) { return; } else if (finishedCompilation(path.getCompilationUnit())) {
static ErrorProneAnalyzer createWithCustomDescriptionListener( CodeTransformer codeTransformer, ErrorProneOptions errorProneOptions, Context context, DescriptionListener.Factory descriptionListenerFactory) { return new ErrorProneAnalyzer( Suppliers.ofInstance(codeTransformer), errorProneOptions, context, descriptionListenerFactory); }
public static ErrorProneAnalyzer createByScanningForPlugins( ScannerSupplier scannerSupplier, ErrorProneOptions errorProneOptions, Context context) { return new ErrorProneAnalyzer( scansPlugins(scannerSupplier, errorProneOptions, context), errorProneOptions, context, JavacErrorDescriptionListener.provider(context)); }