Skip to content

Commit f4160b7

Browse files
Excavator: Upgrades Baseline to the latest version (#361)
1 parent e606a38 commit f4160b7

File tree

11 files changed

+54
-442
lines changed

11 files changed

+54
-442
lines changed

assertj-error-prone/build.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ dependencies {
66
implementation 'com.google.code.findbugs:jsr305'
77
implementation 'com.google.errorprone:error_prone_annotation'
88
implementation 'com.google.errorprone:error_prone_check_api'
9-
implementation 'com.google.errorprone:javac'
109
implementation 'com.google.guava:guava'
1110
implementation 'org.assertj:assertj-core'
1211

@@ -19,10 +18,17 @@ dependencies {
1918
compileOnly 'com.google.auto.service:auto-service'
2019
}
2120

22-
// Incorrectly identifies tests as junit4 usage
23-
tasks.checkJUnitDependencies.enabled = false
24-
tasks.withType(JavaCompile) {
25-
options.errorprone.disable 'StrictUnusedVariable', 'PreferSafeLoggingPreconditions'
21+
moduleJvmArgs {
22+
exports = [
23+
'jdk.compiler/com.sun.tools.javac.api',
24+
'jdk.compiler/com.sun.tools.javac.code',
25+
'jdk.compiler/com.sun.tools.javac.comp',
26+
'jdk.compiler/com.sun.tools.javac.file',
27+
'jdk.compiler/com.sun.tools.javac.main',
28+
'jdk.compiler/com.sun.tools.javac.model',
29+
'jdk.compiler/com.sun.tools.javac.parser',
30+
'jdk.compiler/com.sun.tools.javac.processing',
31+
'jdk.compiler/com.sun.tools.javac.tree',
32+
'jdk.compiler/com.sun.tools.javac.util',
33+
]
2634
}
27-
28-

assertj-error-prone/src/main/java/com/palantir/assertj/errorprone/AssertjBooleanConjunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class AssertjBooleanConjunction implements AssertjChecker {
4141
private static final Matcher<ExpressionTree> isTrue = MethodMatchers.instanceMethod()
4242
.onDescendantOf("org.assertj.core.api.AbstractBooleanAssert")
4343
.named("isTrue")
44-
.withParameters();
44+
.withNoParameters();
4545

4646
private static final Matcher<Tree> isStatement =
4747
Matchers.parentNode(Matchers.kindIs(Tree.Kind.EXPRESSION_STATEMENT));

assertj-error-prone/src/main/java/com/palantir/assertj/errorprone/AssertjPrimitiveComparison.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public final class AssertjPrimitiveComparison implements AssertjChecker {
4444
private static final Matcher<ExpressionTree> IS_TRUE = MethodMatchers.instanceMethod()
4545
.onDescendantOf("org.assertj.core.api.Assert")
4646
.named("isTrue")
47-
.withParameters();
47+
.withNoParameters();
4848

4949
private static final Matcher<ExpressionTree> IS_FALSE = MethodMatchers.instanceMethod()
5050
.onDescendantOf("org.assertj.core.api.Assert")
5151
.named("isFalse")
52-
.withParameters();
52+
.withNoParameters();
5353

5454
private static final Matcher<ExpressionTree> BOOLEAN_ASSERT = Matchers.anyOf(IS_TRUE, IS_FALSE);
5555

assertj-error-prone/src/main/java/com/palantir/assertj/errorprone/AssertjSameSizeAs.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public final class AssertjSameSizeAs implements AssertjChecker {
5757
MethodMatchers.instanceMethod()
5858
.onDescendantOf(Collection.class.getName())
5959
.named("size")
60-
.withParameters(),
60+
.withNoParameters(),
6161
(Matcher<ExpressionTree>) (expressionTree, state) -> {
6262
Symbol symbol = ASTHelpers.getSymbol(expressionTree);
6363
return symbol != null
@@ -72,12 +72,12 @@ public final class AssertjSameSizeAs implements AssertjChecker {
7272
TypePredicates.isDescendantOf(Map.class.getName()),
7373
TypePredicates.not(TypePredicates.isDescendantOf(Iterable.class.getName()))))
7474
.named("size")
75-
.withParameters());
75+
.withNoParameters());
7676

7777
private static final Matcher<ExpressionTree> csSizeMatcher = Matchers.ignoreParens(MethodMatchers.instanceMethod()
7878
.onDescendantOf(CharSequence.class.getName())
7979
.named("length")
80-
.withParameters());
80+
.withNoParameters());
8181

8282
private static final Matcher<ExpressionTree> matcher = Matchers.anyOf(
8383
Matchers.methodInvocation(hasSizeMatcher, ChildMultiMatcher.MatchType.ALL, Matchers.anyOf(sizeMatcher)),

assertj-error-prone/src/main/java/com/palantir/assertj/errorprone/AssertjSize.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ public final class AssertjSize implements AssertjChecker {
4343
MethodMatchers.instanceMethod()
4444
.onDescendantOf(CharSequence.class.getName())
4545
.named("length")
46-
.withParameters(),
46+
.withNoParameters(),
4747
MethodMatchers.instanceMethod()
4848
// Avoid refactoring maps which implement iterable due to ambiguity between assertThat(Iterable)
4949
// and assertThat(Map). This could be improved in a later change to cast to a Map and refactor.
5050
.onClass(TypePredicates.allOf(
5151
TypePredicates.isDescendantOf(Map.class.getName()),
5252
TypePredicates.not(TypePredicates.isDescendantOf(Iterable.class.getName()))))
5353
.named("size")
54-
.withParameters(),
54+
.withNoParameters(),
5555
MethodMatchers.instanceMethod()
5656
.onDescendantOf(Collection.class.getName())
5757
.named("size")
58-
.withParameters(),
58+
.withNoParameters(),
5959
(Matcher<ExpressionTree>) (expressionTree, state) -> {
6060
Symbol symbol = ASTHelpers.getSymbol(expressionTree);
6161
return symbol != null
@@ -83,11 +83,11 @@ public final class AssertjSize implements AssertjChecker {
8383
private static final Matcher<ExpressionTree> isZero = MethodMatchers.instanceMethod()
8484
.onDescendantOf("org.assertj.core.api.Assert")
8585
.namedAnyOf("isZero")
86-
.withParameters();
86+
.withNoParameters();
8787
private static final Matcher<ExpressionTree> isNotZero = MethodMatchers.instanceMethod()
8888
.onDescendantOf("org.assertj.core.api.Assert")
8989
.namedAnyOf("isNotZero")
90-
.withParameters();
90+
.withNoParameters();
9191
private static final Matcher<ExpressionTree> comparisonTo =
9292
Matchers.anyOf(isEqualTo, isLessThan, isLessThanOrEqualTo, isGreaterThan, isGreaterThanOrEqualTo);
9393

assertj-error-prone/src/main/java/com/palantir/assertj/errorprone/PreferAssertj.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public final class PreferAssertj extends BugChecker
166166
private static final Matcher<ExpressionTree> FAIL = MethodMatchers.staticMethod()
167167
.onClassAny(LEGACY_ASSERT_CLASSES)
168168
.named("fail")
169-
.withParameters();
169+
.withNoParameters();
170170

171171
private static final Matcher<ExpressionTree> FAIL_DESCRIPTION = MethodMatchers.staticMethod()
172172
.onClassAny(LEGACY_ASSERT_CLASSES)
@@ -887,7 +887,7 @@ public boolean apply(Type type, VisitorState state) {
887887
MethodMatchers.staticMethod()
888888
.onClass(MATCHERS)
889889
.named("nullValue")
890-
.withParameters(),
890+
.withNoParameters(),
891891
MethodMatchers.staticMethod()
892892
.onClass(MATCHERS)
893893
.named("nullValue")
@@ -897,7 +897,7 @@ public boolean apply(Type type, VisitorState state) {
897897
MethodMatchers.staticMethod()
898898
.onClass(MATCHERS)
899899
.named("notNullValue")
900-
.withParameters(),
900+
.withNoParameters(),
901901
MethodMatchers.staticMethod()
902902
.onClass(MATCHERS)
903903
.named("notNullValue")
@@ -928,7 +928,7 @@ public boolean apply(Type type, VisitorState state) {
928928
MethodMatchers.staticMethod()
929929
.onClass(MATCHERS)
930930
.namedAnyOf("empty", "emptyIterable", "emptyArray", "anEmptyMap")
931-
.withParameters(),
931+
.withNoParameters(),
932932
MethodMatchers.staticMethod()
933933
.onClass(MATCHERS)
934934
.namedAnyOf("emptyCollectionOf", "emptyIterableOf")

0 commit comments

Comments
 (0)