Error-prone catches common Java mistakes as compile-time errors.
Questions tagged [errorprone]
45 questions
10
votes
4 answers
How to exclude error prone from being run on unit tests?
When maven-compiler-plugin:3.8.0:testCompile @ foo-child runs, thread dumps show errorprone is taking an extremely long time. I believe there is a bug with errorprone, but for now I'd rather just have errorprone not run on unit tests.
I have a…

lf215
- 1,185
- 7
- 41
- 83
7
votes
2 answers
Prohibit brackets after method signature in Java code
In my project recently I've encountered code that compiles perfectly fine, however is very surprising to any reader and should not pass static analysis.
class BracketsAfterMethodSignature {
Object emptyArray()[] {
return new Object[]{};
…

Michal Kordas
- 10,475
- 7
- 58
- 103
6
votes
1 answer
What is a Javadoc summary fragment?
I am trying to adhere to Java Style Guide as suggested by Error Prone.
Section 7.2 The summary fragment states the following:
Each Javadoc block begins with a brief summary fragment. This fragment is very important: it is the only part of the text…

Matthew
- 1,905
- 3
- 19
- 26
6
votes
0 answers
Why use Error-prone plugin in Android Studio
I have recently installed Error-prone plugin in Android-Studio and configured the settings as explained on its website.
The plugin is working fine but I have noticed that whatever errors the Error-prone-plugin shows, at compile time, is already…

Rohit Gupta
- 1,368
- 1
- 14
- 30
5
votes
1 answer
Can Checker Framework be used with Error Prone?
Can the Checker Framework be used with Error Prone? As far as I can tell they fill overlapping purpose as compile time checking, but they don't do all the same things. I use gradle, but I doubt both plugins can be used at the same time (in fact…

xenoterracide
- 16,274
- 24
- 118
- 243
5
votes
1 answer
Disable error prone in bazel
I have a project with a lot of code. Some of this code doesn't pass error-prone inspections turned on by default in Bazel. I want to disable error-prone in bazel. Is it possible to do it without adding a command line argument via the WORKSPACE…

Konstantin Solomatov
- 10,252
- 8
- 58
- 88
5
votes
1 answer
Compilation error while upgrading from Guava 19 to 20
Trying to upgrade guava from version 19 to 20 and getting this error:
Error:java: cannot access com.google.errorprone.annotations.CanIgnoreReturnValue
class file for com.google.errorprone.annotations.CanIgnoreReturnValue not found
Any ideas how…

valodzka
- 5,535
- 4
- 39
- 50
5
votes
3 answers
How do I make error-prone ignore my generated source code?
I've recently discovered Error Prone and am integrating it into my Android build using the Gradle plugin linked on their page.
Since our project is using Icepick (and some other code generating annotation processors), we have generated source code,…

Argyle
- 3,324
- 25
- 44
5
votes
2 answers
Google errorprone java compiler - Bugs during maven build: java.lang.NoSuchFieldError: pid
I have added the following to the pom file:
org.apache.maven.plugins
…

mjs
- 21,431
- 31
- 118
- 200
4
votes
1 answer
how to setup error prone with gradle (getting various errors)
I am trying to setup error prone using gradle, however everything ive tried gives me some kind of error:
To test I have setup a simple hello world java program using gradle, which without error prone compiles fine.
Then I read:…

Ben
- 41
- 1
- 3
4
votes
2 answers
How to install Uber's nullaway static analysis tool in android studio?
I'm having trouble to use errorprone and nullaway in android studio.
Looks like nullaway depends on errorprone. These are static analysis tools to avoid NPE. The documentation on how to use nullaway in android on the nullaway github page is very…

j2emanue
- 60,549
- 65
- 286
- 456
4
votes
1 answer
adding errorprone to gradle build file
I am trying to add errorprone to my gradle build file as follows:
relevant parts of build.gradle
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath…

ali haider
- 19,175
- 17
- 80
- 149
3
votes
2 answers
Can Error Prone Auto-Apply Suggested Fixes?
From what I read about Error Prone, I see that it will actually suggest fixes for style errors in your code. i.e from https://errorprone.info/docs/installation:
ERROR: example/myproject/BUILD:29:1: Java compilation in rule…

Tyler R
- 474
- 2
- 6
- 15
3
votes
1 answer
How to exclude more then one path from error prone?
I would like to exclude a few directories form error prone. I was trying to use a XepExcludedPaths flag but it seems that it works only for the one path which is a regular expresion of excluded…

tomasz-mer
- 3,753
- 10
- 50
- 69
3
votes
1 answer
How do I change warnings to Errors with Error Prone?
When I run mvn clean compile
org.apache.maven.plugins
maven-compiler-plugin
javac-with-errorprone
…

xenoterracide
- 16,274
- 24
- 118
- 243