RemoveUnusedImports
Unused imports

Severity
SUGGESTION
Tags
Style

The problem

This import is unused.

The check reported an import that was actually used!

The check has no known bugs. If it reports an unused import that looks like it was actually used, try removing it and recompiling. If everything still compiles, it was unused.

Note that the check can detect some unused imports that google-java-format cannot. The formatter looks at a single file at a time, so RemoveUnusedImports is more accurate in examples like the following:

package a;

import b.Baz; // this is unused!

class Foo extends Bar {
  Baz baz; // this is a.Bar.Baz (from the supertype), *not* b.Baz
}
package a;
class Bar {
  class Baz {}
}
package b;
class Baz {}