Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ bndlib = { module = "biz.aQute.bnd:biz.aQute.bndlib", version.ref = "bnd" }
checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref = "checkstyle" }
classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.184" }
commons-io = { module = "commons-io:commons-io", version = "2.20.0" }
errorProne-core = { module = "com.google.errorprone:error_prone_core", version = "2.42.0" }
error-prone-contrib = { module = "tech.picnic.error-prone-support:error-prone-contrib", version = "0.25.0" }
error-prone-core = { module = "com.google.errorprone:error_prone_core", version = "2.42.0" }
fastcsv = { module = "de.siegmar:fastcsv", version = "4.1.0" }
groovy = { module = "org.apache.groovy:groovy", version = "5.0.1" }
groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.23" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,53 @@ plugins {
}

dependencies {
errorprone(dependencyFromLibs("errorProne-core"))
errorprone(dependencyFromLibs("error-prone-contrib"))
errorprone(dependencyFromLibs("error-prone-core"))
errorprone(dependencyFromLibs("nullaway"))
constraints {
errorprone("com.google.guava:guava") {
version {
require("33.4.8-jre")
}
because("Older versions use deprecated methods in sun.misc.Unsafe")
// https://github.com/junit-team/junit-framework/pull/5039#discussion_r2414490581
}
}
}

nullaway {
onlyNullMarked = true
}

tasks.withType<JavaCompile>().configureEach {
options.errorprone {
val shouldDisableErrorProne = java.toolchain.implementation.orNull == JvmImplementation.J9
if (name == "compileJava" && !shouldDisableErrorProne) {
disable(

// This check is opinionated wrt. which method names it considers unsuitable for import which includes
// a few of our own methods in `ReflectionUtils` etc.
"BadImport",

// The findings of this check are subjective because a named constant can be more readable in many cases
"UnnecessaryLambda",

// Resolving findings for these checks requires ErrorProne's annotations which we don't want to use
"AnnotateFormatMethod",
"AnnotateFormatMethod", // We don`t want to use ErrorProne`s annotations.
"BadImport", // This check is opinionated wrt. which method names it considers unsuitable for import which includes a few of our own methods in `ReflectionUtils` etc.
"DoNotCallSuggester",
"InlineMeSuggester",
"ImmutableEnumChecker",

// Resolving findings for this check requires using Guava which we don't want to use
"StringSplitter",

// Produces a lot of findings that we consider to be false positives, for example for package-private
// classes and methods
"MissingSummary",
"InlineMeSuggester",
"MissingSummary", // Produces a lot of findings that we consider to be false positives, for example for package-private classes and methods.
"StringSplitter", // We don`t want to use Guava.
"UnnecessaryLambda", // The findings of this check are subjective because a named constant can be more readable in many cases.
// picnic (https://error-prone.picnic.tech)
"ConstantNaming",
"DirectReturn", // https://github.com/junit-team/junit-framework/pull/5006#discussion_r2403984446
"FormatStringConcatenation",
"IdentityConversion",
"LexicographicalAnnotationAttributeListing",
"LexicographicalAnnotationListing",
"MissingTestCall",
"NestedOptionals",
"NonStaticImport",
"OptionalOrElseGet",
"PrimitiveComparison",
"StaticImport",
"TimeZoneUsage",
Comment on lines +40 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to address these (except DirectReturn) in separate PRs?

Copy link
Contributor Author

@Pankraz76 Pankraz76 Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Lexa is something easy to consider, if this meets the taste of the community.

Static import is something to suggest to avoid lots of redundant context. Collection. stuff.

ConstantNaming is also kind of a no-brainer, as it's the quintessence of JCC, but here it's not fixable.
We'll handle this successfully in Spotless, so this is something to investigate further.

Everything else is then up to the community, kind of, as we definitely need all of these, as we are failing them even though it should not be necessary! (since they are not all error severity, but even low-level like suggestion). Isn't it? @rickie

This itself indicates some misconfigured or problematic tooling.

Thank you both for the great learning experience - both technical and foremost in social regards, which is kind of a big challenge for me personally.

Please excuse me for being inconsistent sometimes.

)
error(
"PackageLocation",
"RedundantStringConversion",
"RedundantStringEscape",
)
error("PackageLocation")
} else {
disableAllChecks = true
}
Expand All @@ -61,6 +65,7 @@ tasks.withType<JavaCompile>().configureEach {
} else {
enable()
}
onlyNullMarked = true
isJSpecifyMode = true
customContractAnnotations.add("org.junit.platform.commons.annotation.Contract")
checkContracts = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void beforeThreadInterrupt(PreInterruptContext preInterruptContext, Exten
sb.append(NL);
// Use the same prefix as java.lang.Throwable.printStackTrace(PrintStreamOrWriter)
sb.append("\tat ");
sb.append(stackTraceElement.toString());
sb.append(stackTraceElement);
}
sb.append(NL);
}
Expand Down