I use Guava Ordering to sort the list of objects based on the ordering of the list of identifiers corresponding to the objects. In some cases, there is a mismatch between the two lists (the identifier comes from the web GUI, while the entities come from the database), since several users can manipulate the same enitity.
In these cases, Ordering throws a IncomparableValueException . I would like to catch this exception to provide the user with an informative error message. But I can not, because the exception is a local package, not a public one. This causes the exception handling code to be more messy than it should be (I should throw a ClassCastException instead).
Why is this exception not publicly available? Since it is ejected from the Guava framework, I expect to be able to catch it.
You can also add that in my original version (13.0.2) the exception was javadoc + TODO, saying "make it public and documented", in the newest version (18.0), both javadoc and TODO, the exception is still locally local.
source share