Skip to content

Commit

Permalink
Fix compilation for JDK 8
Browse files Browse the repository at this point in the history
This also fixes #2554, by using `.withNoParameters()` instead.
  • Loading branch information
TimvdLippe committed Jan 27, 2022
1 parent ffa7e61 commit b2dc113
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Expand Up @@ -52,8 +52,10 @@ allprojects { proj ->
mavenCentral()
google()
}
plugins.withId('java') {
proj.apply from: "$rootDir/gradle/errorprone.gradle"
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
plugins.withId('java') {
proj.apply from: "$rootDir/gradle/errorprone.gradle"
}
}
tasks.withType(JavaCompile) {
//I don't believe those warnings add value given modern IDEs
Expand Down
7 changes: 6 additions & 1 deletion settings.gradle.kts
Expand Up @@ -14,11 +14,16 @@ include("inline",
"junitJupiterInlineMockMakerExtensionTest",
"module-test",
"memory-test",
"errorprone",
"junitJupiterParallelTest",
"osgi-test",
"bom")

if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
include("errorprone")
} else {
logger.info("Not including errorprone, which requires minimum JDK 11+")
}

if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17) && (System.getenv("ANDROID_SDK_ROOT") != null || File(".local.properties").exists())) {
include("androidTest")
} else {
Expand Down
Expand Up @@ -49,7 +49,7 @@ public class MockitoAnyIncorrectPrimitiveType extends AbstractMockitoAnyForPrimi
};

private static final Matcher<ExpressionTree> METHOD_MATCHER =
staticMethod().onClassAny(CLASS_NAMES).withNameMatching(METHOD_NAME_PATTERN).withParameters();
staticMethod().onClassAny(CLASS_NAMES).withNameMatching(METHOD_NAME_PATTERN).withNoParameters();

@Override
protected Matcher<? super MethodInvocationTree> matcher() {
Expand Down

0 comments on commit b2dc113

Please sign in to comment.