posted 15 years ago
Well when line 1 is at its original position, then there's a if condition there. So the compiler will think that NullPointerException may or may not be thrown. But if you move it below the other throw clause, then it definitely becomes unreachable, there's no way that control could reach the next statement to that throw statement. That's why the compiler complaints that the statement is unreachable. I know that the if condition will always be true so the NullPointerException will always be thrown, but the compiler for some reasons ignores that...