I know the general matter has been discussed in this stackoverflow topic already (constructors never return null
), but considering its significance in this concrete matter, I would like to know if the official Android documentation of the SoundPool
constructor is wrong then:
Constructor. Returns a SoundPool object, or null if creation failed
I'm asking this because we're talking about no less than the official documentation of Android that has been up for years (in case of SoundPool
).
Checking the Android source code, the SoundPool
throws a RuntimeException
in case of an error in constructor. (The pre-2.3 Android did not even throw an exception.) Perhaps the documentation tries to express that if the exception is caught, then the variable where I intended to store the object reference remains null? In this case, the doc is still very poorly worded. Am I missing something?
EDIT: considering this might not be a very content-rich question (even though it may be useful -- see my comments), a simple Yes or No would be sufficient, and then the thread can get closed. I want to make sure I haven't overlooked anything.