Catch common Java mistakes as compile-time errors
Java Other
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github Add an ISSUE_TEMPLATE Jan 3, 2018
.idea Fix IntelliJ copyright header template Jan 10, 2018
annotation Permit @SuppressWarnings alongside custom annotations. Jun 4, 2018
annotations Try to specify @OverridingMethodsMustInvokeSuper, and recommend bette… Aug 2, 2018
ant Refer to 2.3.2-SNAPSHOT internally May 11, 2018
check_api Add support for propagating a short description attached to Suggested… Aug 17, 2018
core Update annotation handling after 9dca586b31380d6d1acd047e4fc9b0d1e8ed… Aug 17, 2018
docgen Generate bugpattern links before tables Aug 6, 2018
docgen_processor Refer to 2.3.2-SNAPSHOT internally May 11, 2018
docs/bugpattern Add a bugpattern to catch instanceof checks which are always true or … Aug 15, 2018
examples Update the Refaster rule build instructions Aug 6, 2018
refaster Refer to 2.3.2-SNAPSHOT internally May 11, 2018
test_helpers Fix -Xmx flags for JDK 8 build Aug 7, 2018
third_party/java/auto Initial bazel build Apr 18, 2015
type_annotations Refer to 2.3.2-SNAPSHOT internally May 11, 2018
util Don't delete orphaned bugpattern markdown files. Apr 16, 2018
.gitignore Remove redundant calls to `String.toString()` Jul 6, 2017
.travis.yml Enable JDK 11 build Aug 8, 2018
AUTHORS Add String.split check, and make all existing code pass it Dec 21, 2017
CONTRIBUTING.md Add CONTRIBUTING file Dec 18, 2014
COPYING Initial commit. Basic Predicate DSL for matchers, and check for one e… Sep 15, 2011
README.md Use https instead of http May 10, 2018
WORKSPACE Initial bazel build Apr 18, 2015
appveyor.yml Don't notify on appveyor build success Nov 16, 2016
pom.xml Update checker framework version 2.5.3 Jul 13, 2018

README.md

Error Prone

Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time.

public class ShortSet {
  public static void main (String[] args) {
    Set<Short> s = new HashSet<>();
    for (short i = 0; i < 100; i++) {
      s.add(i);
      s.remove(i - 1);
    }
    System.out.println(s.size());
  }
}
error: [CollectionIncompatibleType] Argument 'i - 1' should not be passed to this method;
its type int is not compatible with its collection's type argument Short
      s.remove(i - 1);
              ^
    (see https://errorprone.info/bugpattern/CollectionIncompatibleType)
1 error

Getting Started

Our documentation is at errorprone.info.

Error Prone works with Bazel, Maven, Ant, and Gradle. See our installation instructions for details.

Developing Error Prone

Developing and building Error Prone is documented on the wiki.

Links