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:
igor%mir2.org 2003-08-06 07:37:27 +00:00
Родитель 33b1784614
Коммит f95ae1ab5b
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -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");
}