Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions baseline-refaster-javac-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apply from: "${rootDir}/gradle/publish-jar.gradle"

dependencies {
compile 'com.google.errorprone:error_prone_refaster'
compile 'org.slf4j:slf4j-api'

annotationProcessor 'com.google.auto.service:auto-service'
compileOnly 'com.google.auto.service:auto-service'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* TaskListener that receives compilation of a Refaster rule class and outputs a combined serialized analyzer
Expand All @@ -41,6 +43,7 @@
*/
public final class BaselineRefasterCompilerAnalyzer implements TaskListener {

private static final Logger log = LoggerFactory.getLogger(BaselineRefasterCompilerAnalyzer.class);
private final Context context;
private final Path destinationPath;

Expand Down Expand Up @@ -72,7 +75,11 @@ public void finished(TaskEvent taskEvent) {
new TreeScanner<Void, Context>() {
@Override
public Void visitClass(ClassTree node, Context classContext) {
rules.addAll(RefasterRuleBuilderScanner.extractRules(node, classContext));
try {
rules.addAll(RefasterRuleBuilderScanner.extractRules(node, classContext));
} catch (RuntimeException | Error e) {
log.warn("Failed to extract rules", e);
}
return super.visitClass(node, classContext);
}
}.scan(tree, context);
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-904.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Continue when RefasterRuleBuilderScanner throws
links:
- https://github.com/palantir/gradle-baseline/pull/904