[java]
* @throws NullPointerException If child is null.
*/
public int attachChild(Spatial child) {
if (child == null)
throw new IllegalArgumentException(“child cannot be null”);
[/java]
The documentation should probably say
[java]
* @throws IllegalArgumentException If child is null.
[/java]
Or perhaps the code should be changed to match the JavaDoc, though that might conceivably break someone’s app.
@sgold said:
[java]
* @throws NullPointerException If child is null.
*/
public int attachChild(Spatial child) {
if (child == null)
throw new IllegalArgumentException("child cannot be null");
[/java]
The documentation should probably say
[java]
* @throws IllegalArgumentException If child is null.
[/java]
Or perhaps the code should be changed to match the JavaDoc, though that might conceivably break someone’s app.
No, the old code was silly and was fixed. Now the javadoc is wrong. Code should never throw NullPointerException.
Thanks to whoever threw me the minus about a javadoc change… I will now NEVER be making this change that is somehow critical. Sometimes this community bites.
Hopefully someone else will care enough to help. I’m done with these threads.
Maybe instead of -1ing people you could file a bug report so that the person who incompletely made the original change might finish noting this “exception that you should not be catching anyway”.