salesforce / bazel-jdt-java-toolchain

Eclipse Java Compiler (ECJ) for Bazel
Apache License 2.0
9 stars 6 forks source link

Integrate Error Prone into ECJ #7

Open guw opened 2 years ago

guw commented 2 years ago

There are two possible approaches:

  1. Add abstraction into Error Prone to become independent of javac as described in https://github.com/google/error-prone/issues/11
  2. Build a bridge that translates from ECJ AST into javac classes and ensure Error Prone accepts those

We need to figure out what is the better strategy to go with. Having Error Prone integrated directly with ECJ would be nice because we are using ECJ as well in the Bazel Language Server (Eclipse and VS Code)

Error Prone is currently integrated in the Bazel Java Compiles via ErrorPronePlugin

/**
 * A plugin for BlazeJavaCompiler that performs Error Prone analysis. Error Prone is a static
 * analysis framework that we use to perform some simple static checks on Java code.
 */
public final class ErrorPronePlugin extends BlazeJavaCompilerPlugin {..}