- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
/* ------------------------------------------------------------ */
private boolean isJspServlet ()
{
if (_servlet == null)
return false;
Class c = _servlet.getClass();
boolean result = false;
while (c != null && !result)
{
result = isJspServlet(c.getName());
c = c.getSuperclass();
}
return result;
}
/* ------------------------------------------------------------ */
private boolean isJspServlet (String classname)
{
if (classname == null)
return false;
return ("org.apache.jasper.servlet.JspServlet".equals(classname));
}
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: Хотел что-то спросить по Хаскелю, а потом забыл.
Читер!
и два пузырька зелёнки, пожалуйста