Skip to content

Commit 3fff610

Browse files
cushonError Prone Team
authored andcommitted
Update hamcrest to v2.2
PiperOrigin-RevId: 637991390
1 parent 6f265dd commit 3fff610

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@
144144
<!-- BSD New (3 clause) -->
145145
<groupId>org.hamcrest</groupId>
146146
<artifactId>hamcrest-core</artifactId>
147-
<version>1.3</version>
147+
<version>2.2</version>
148148
<scope>test</scope>
149149
</dependency>
150150
<dependency>
151151
<!-- BSD New (3 clause) -->
152152
<groupId>org.hamcrest</groupId>
153153
<artifactId>hamcrest-library</artifactId>
154-
<version>1.3</version>
154+
<version>2.2</version>
155155
<scope>test</scope>
156156
</dependency>
157157
<dependency>

core/src/main/java/com/google/errorprone/bugpatterns/ExpectedExceptionChecker.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,15 @@ public class ExpectedExceptionChecker extends BugChecker implements MethodTreeMa
7878
.withNameMatching(Pattern.compile("expect.*")));
7979

8080
static final Matcher<ExpressionTree> IS_A =
81-
staticMethod()
82-
.onClassAny("org.hamcrest.Matchers", "org.hamcrest.CoreMatchers", "org.hamcrest.core.Is")
83-
.withSignature("<T>isA(java.lang.Class<T>)");
81+
anyOf(
82+
staticMethod()
83+
.onClassAny(
84+
"org.hamcrest.Matchers", "org.hamcrest.CoreMatchers", "org.hamcrest.core.Is")
85+
.withSignature("<T>isA(java.lang.Class<T>)"),
86+
staticMethod()
87+
.onClassAny(
88+
"org.hamcrest.Matchers", "org.hamcrest.CoreMatchers", "org.hamcrest.core.Is")
89+
.withSignature("<T>isA(java.lang.Class<?>)"));
8490

8591
static final Matcher<StatementTree> FAIL_MATCHER =
8692
anyOf(

0 commit comments

Comments
 (0)