зеркало из https://github.com/mozilla/gecko-dev.git
I changed Context.codeBug to return RuntimeException instead of void to be able to wright "throw Context.codeBug()" when simple "Context.codeBug()" leads to a compile error about unreachable code or missed return.
This commit is contained in:
Родитель
33b1784614
Коммит
f95ae1ab5b
|
@ -2094,8 +2094,13 @@ public class Context {
|
|||
|
||||
/**
|
||||
* Throws RuntimeException to indicate failed assertion.
|
||||
* The function never returns and its return type is RuntimeException
|
||||
* only to be able to write <tt>throw Context.codeBug()</tt> if plain
|
||||
* <tt>Context.codeBug()</tt> triggers unreachable code error.
|
||||
*/
|
||||
public static void codeBug() throws RuntimeException {
|
||||
public static RuntimeException codeBug()
|
||||
throws RuntimeException
|
||||
{
|
||||
throw new RuntimeException("FAILED ASSERTION");
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче