Skip to content

Commit

Permalink
Enable Error Prone's VoidMissingNullable check (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 authored Aug 18, 2022
1 parent 7883b31 commit 4ca75c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,21 @@ private static ImmutableList<ImmutableList<String>> getStructure(
new TreeScanner<Void, Void>() {
@Nullable
@Override
public Void visitIdentifier(IdentifierTree node, Void ctx) {
public Void visitIdentifier(IdentifierTree node, @Nullable Void ctx) {
nodes.add(tokenize(node));
return super.visitIdentifier(node, ctx);
}

@Nullable
@Override
public Void visitLiteral(LiteralTree node, Void ctx) {
public Void visitLiteral(LiteralTree node, @Nullable Void ctx) {
nodes.add(tokenize(node));
return super.visitLiteral(node, ctx);
}

@Nullable
@Override
public Void visitPrimitiveType(PrimitiveTypeTree node, Void ctx) {
public Void visitPrimitiveType(PrimitiveTypeTree node, @Nullable Void ctx) {
nodes.add(tokenize(node));
return super.visitPrimitiveType(node, ctx);
}
Expand Down
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1541,9 +1541,6 @@
-Xep:StaticOrDefaultInterfaceMethod:OFF
<!-- We generally discourage `var` use. -->
-Xep:Varifier:OFF
<!-- XXX: This check flags false positives.
See https://github.com/google/error-prone/issues/2679. -->
-Xep:VoidMissingNullable:OFF
-XepOpt:CheckReturnValue:CheckAllConstructors=true
<!-- XXX: Enable once there are fewer
false-positives.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private boolean containsRefasterTemplates(ClassTree tree) {
return Boolean.TRUE.equals(
new TreeScanner<Boolean, Void>() {
@Override
public Boolean visitAnnotation(AnnotationTree node, Void v) {
public Boolean visitAnnotation(AnnotationTree node, @Nullable Void v) {
Symbol sym = ASTHelpers.getSymbol(node);
return (sym != null
&& sym.getQualifiedName()
Expand All @@ -93,7 +93,7 @@ private ImmutableListMultimap<ClassTree, CodeTransformer> compileRefasterTemplat
new TreeScanner<Void, Void>() {
@Nullable
@Override
public Void visitClass(ClassTree node, Void v) {
public Void visitClass(ClassTree node, @Nullable Void v) {
rules.putAll(node, RefasterRuleBuilderScanner.extractRules(node, context));
return super.visitClass(node, null);
}
Expand Down

0 comments on commit 4ca75c6

Please sign in to comment.