Remove exclusion of `META-INF/versions/9/OSGI-INF/MANIFEST.MF`. [JSpecify 1.0.1](https://github.com/jspecify/jspecify/releases) removed that file from the JSpecify jar. (You can see the history of why the exclusion was added in https://github.com/google/error-prone/commit/2517f1b44b704f4e7e42f8178b21d461a391df44.) I do notice some other preexisting shading-related diagnostics, though they are only warnings: ``` [INFO] --- shade:3.6.2:shade (default) @ error_prone_refaster --- [WARNING] error_prone_core-1.0-HEAD-SNAPSHOT-with-dependencies.jar, error_prone_refaster-1.0-HEAD-SNAPSHOT.jar define 2 overlapping resources: [WARNING] - META-INF/MANIFEST.MF [WARNING] - META-INF/services/com.sun.source.util.Plugin [WARNING] maven-shade-plugin has detected that some files are [WARNING] present in two or more JARs. When this happens, only one [WARNING] single version of the file is copied to the uber jar. [WARNING] Usually this is not harmful and you can skip these warnings, [WARNING] otherwise try to manually exclude artifacts based on [WARNING] mvn dependency:tree -Ddetail=true and the above output. [WARNING] See https://maven.apache.org/plugins/maven-shade-plugin/ ``` I also notice this: ``` [INFO] --- bnd:7.3.0:bnd-process (generate-OSGi-manifest) @ error_prone_refaster --- [WARNING] Cannot consider developer in line '57' of file '/usr/local/google/home/cpovirk/clients/error-prone-white/error-prone/pom.xml' for bundle header 'Bundle-Developers' as it does not contain the mandatory id. ``` Again, that's unrelated. PiperOrigin-RevId: 962955941
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
Our documentation is at errorprone.info.
Error Prone works with Bazel, Maven, Ant, and Gradle. See our installation instructions for details.
Developing and building Error Prone is documented on the wiki.