The exceptions in RHN java are defined in buildconf/exceptions.xml. We need a script, ant task or program that can parse the file and determine whether the exception defined is used by any of the code.
scripts/unUsedExceptions.pl is now in the repo for just this task.