It seems that RedundantStringConversion somehow is one of the few one always to be applied, but non of the others root checks.
Others like UnusedMethod, UnusedVariable and many more does not get applied despite it, the log shoes a Did you mean message, considering its patchable.
I can also confirm that sometimes the plugin like methods and stuff apply a lot by patching, until it fails to patch giving not the considered fix upfront.
config:
import static java.lang.System.getenv
apply plugin: 'net.ltgt.errorprone'
dependencies {
errorprone('com.google.errorprone:error_prone_core:2.42.0')
errorprone('tech.picnic.error-prone-support:error-prone-contrib:0.25.0')
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
}
}
}
tasks.withType(JavaCompile).configureEach {
options.errorprone {
disableAllChecks = true // consider removal to avoid error prone error´s, following convention over configuration.
error('RedundantStringConversion')
error('UnusedMethod')
if (!getenv().containsKey('CI') && getenv('IN_PLACE')?.toBoolean()) {
errorproneArgs.addAll(
'-XepPatchLocation:IN_PLACE',
'-XepPatchChecks:UnusedMethod'
)
}
}
}
> Compilation failed; see the compiler output below.
/Users/vincent.potucek/IdeaProjects/spring-boot/buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/ExportedImageTar.java:273: warning: [UnusedVariable] The parameter 'tarFile' is never read.
ManifestLayerArchiveFactory(Path tarFile, ImageArchiveManifest manifest) {
^
(see https://errorprone.info/bugpattern/UnusedVariable)
Did you mean 'ManifestLayerArchiveFactory(ImageArchiveManifest manifest) {'?
Describe the bug
Minimal Reproducible Example
Its just the same code but does not apply on junit.
If applicable and possible, please replace this section with the code that
triggered the isue.
Logs
Please replace this sentence with log output, if applicable.
Expected behavior
Setup
- Operating system (e.g. MacOS Monterey).
- Java version (i.e.
java --version, e.g. 17.0.16).
- Error Prone version (e.g.
2.41.0).
- Error Prone Support version (e.g.
0.24.0).
Additional context
It seems that
RedundantStringConversionsomehow is one of the few one always to be applied, but non of the others root checks.error-prone.picnic.techfeaturingRedundantStringConversionPankraz76/spring-boot#1error-prone.picnic.techfeaturingRedundantStringConversionPankraz76/spring-framework#2Others like
UnusedMethod,UnusedVariableand many more does not get applied despite it, the log shoes aDid you meanmessage, considering its patchable.I can also confirm that sometimes the plugin like methods and stuff apply a lot by patching, until it fails to patch giving not the considered fix upfront.
config:
Describe the bug
of the project.
already known.
Minimal Reproducible Example
ConstantNamingdiffplug/spotless#2687ConstantNamingnot applied PicnicSupermarket/error-prone-support#1923Its just the same code but does not apply on junit.
Logs
Please replace this sentence with log output, if applicable.Expected behavior
Setup
java --version, e.g.17.0.16).2.41.0).0.24.0).Additional context