Runtime exceptions documentation

I’m using the Java API (client-http:4.2.4) and I have troubles finding what exceptions are thrown by each methods. For example, the iri() helper from com.complexible.common.rdf.model.Values.iri throws an InvalidArgumentException if the string is not a valid. But I can’t find this information on the doc (

Am I using the wrong documentation or is there an other way to find this information ?

Runtime exceptions aren’t generally documented in javadocs. You might argue that this shouldn’t be a runtime exception but then you have to deal with it everywhere.

Well, I’m quite happy that they are runtime exceptions and not checked exceptions, it’s so much easier to deal with. But it’s even easier when you know what may throw…

I should probably add that Oracle suggests that runtime exceptions not be added to the javadoc because are catastrophic. This is obviously a case of, checked exceptions are a pain and they kill the readability of the code. Even though they suggest not documenting it they document unchecked exceptions in Collections and say that although not required they can be documented in the Java Language Specification. So guess the best that can be said is document it where it’s helpful.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.