Нашли или выдавили из себя код, который нельзя назвать нормальным,
на который без улыбки не взглянешь?
Не торопитесь его удалять или рефакторить, — запостите его на
говнокод.ру, посмеёмся вместе!
Но всё равно, код Jetty поражает рядом дурацких вещей вроде ненужного сравнения с null в isJspServlet(String) или паскалеподобным стилем выхода из цикла.
return _servlet != null && _servlet instanceof JspServlet;
//А если еще и вспомнить что instanceof проверяет на null, то достаточно
return _servlet instanceof JspServlet;
>ссылка на объект любого класса может быть нуллом
>instanceof
А инстанс не может.
Да и вообще надо помнить о SQLных nullах. Они даже друг дружке не равны.
кстати, мануал к scala.Nothing: Nothing is - together with Null - at the bottom of Scala's type hierarchy.
Nothing is a subtype of every other type (including Null); there exist no instances of this type. Although type Nothing is uninhabited, it is nevertheless useful in several ways. For instance, the Scala library defines a value scala.collection.immutable.Nil of type List[Nothing]. Because lists are covariant in Scala, this makes scala.collection.immutable.Nil an instance of List[T], for any element of type T.
Another usage for Nothing is the return type for methods which never return normally. One example is method error in sys, which always throws an exception.
Fixed?
-> http://govnokod.ru/11479
Но всё равно, код Jetty поражает рядом дурацких вещей вроде ненужного сравнения с null в isJspServlet(String) или паскалеподобным стилем выхода из цикла.
return result
P.S. http://ideone.com/MYkvT
>instanceof
А инстанс не может.
Да и вообще надо помнить о SQLных nullах. Они даже друг дружке не равны.
Тогда уж так: "null не может быть инстансом [никакого класса]".
Nothing is a subtype of every other type (including Null); there exist no instances of this type. Although type Nothing is uninhabited, it is nevertheless useful in several ways. For instance, the Scala library defines a value scala.collection.immutable.Nil of type List[Nothing]. Because lists are covariant in Scala, this makes scala.collection.immutable.Nil an instance of List[T], for any element of type T.
Another usage for Nothing is the return type for methods which never return normally. One example is method error in sys, which always throws an exception.
http://ideone.com/S4HaU
PS: Хотел что-то спросить по Хаскелю, а потом забыл.
Читер!
и два пузырька зелёнки, пожалуйста