Skip to content

Commit

Permalink
Upgrade Error Prone 2.17.0 -> 2.18.0 (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Jan 11, 2023
1 parent f079c53 commit 79356ac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<version.auto-value>1.10.1</version.auto-value>
<version.error-prone>${version.error-prone-orig}</version.error-prone>
<version.error-prone-fork>v${version.error-prone-orig}-picnic-1</version.error-prone-fork>
<version.error-prone-orig>2.17.0</version.error-prone-orig>
<version.error-prone-orig>2.18.0</version.error-prone-orig>
<version.error-prone-slf4j>0.1.17</version.error-prone-slf4j>
<version.guava-beta-checker>1.0</version.guava-beta-checker>
<version.jdk>11</version.jdk>
Expand Down Expand Up @@ -1575,6 +1575,10 @@
<!-- XXX: Enable this once we open-source
this library. -->
-Xep:BetaApi:OFF
<!-- XXX: Enable once compatible with
`UnnecessarilyVisible`. See
https://github.com/google/error-prone/issues/3706. -->
-Xep:InjectOnBugCheckers:OFF
<!-- We don't target JDK 7. -->
-Xep:Java7ApiChecker:OFF
<!-- We don't target JDK 8. -->
Expand All @@ -1583,6 +1587,9 @@
-Xep:StaticOrDefaultInterfaceMethod:OFF
<!-- We generally discourage `var` use. -->
-Xep:Varifier:OFF
<!-- Yoda conditions are not always more
readable than the alternative. -->
-Xep:YodaCondition: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 @@ -161,6 +161,7 @@ private static Optional<SeverityLevel> toSeverityLevel(Severity severity) {
* that could cause {@link VisitorState#reportMatch(Description)}} to override the reported
* severity).
*/
@SuppressWarnings("RestrictedApiChecker" /* We create a heavily customized `Description` here. */)
private static Description augmentDescription(
Description description, Optional<SeverityLevel> severityOverride) {
return Description.builder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public final void apply(TreePath path, Context context, DescriptionListener list
}
}

@SuppressWarnings("RestrictedApiChecker" /* We create a heavily customized `Description` here. */)
private Description augmentDescription(
Description description, CodeTransformer delegate, Context context) {
String shortCheckName = getShortCheckName(description.checkName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private static Description refasterDescription(String name) {
return description(name, Optional.of(""), WARNING, "");
}

@SuppressWarnings("RestrictedApiChecker" /* We create a heavily customized `Description` here. */)
private static Description description(
String name, Optional<String> link, SeverityLevel severityLevel, String message) {
return Description.builder(DUMMY_POSITION, name, link.orElse(null), severityLevel, message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ public Description matchCompilationUnit(CompilationUnitTree compilationUnit, Vis
@Override
public @Nullable Void scan(Tree tree, @Nullable Void unused) {
if (tree instanceof ExpressionTree && delegate.matches((ExpressionTree) tree, state)) {
state.reportMatch(
Description.builder(tree, canonicalName(), null, defaultSeverity(), message())
.build());
state.reportMatch(describeMatch(tree));
}

return super.scan(tree, unused);
Expand Down

0 comments on commit 79356ac

Please sign in to comment.