Solr code has lived with warnings for years. Currently, we've added many "SuppressWarnings" annotations and now fail compilation if new warnings are introduced. We'd like to avoid using SuppressWarnings in new code and provide some guidelines for how to do that correctly.

We also urge people to remove SuppressWarnings annotations as they work on code.

Code patterns and how to fix.

This is a bare skeleton for a start, exactly one example...

  • Map someVar = new HashMap(); generates a "rawtypes" warning. Fix by typing the map and the diamond operator, e.g. Map<String, String> = new HasnMap<>();
  • NamedList There are a LOT  of these