On January 29th, 2008 Justin Hickman (not verified) says:
First of all... Java is not slow. There's a bad misconception in the world that Java is slow because of the previous experiences with Java Applets and prior versions of the JRE. Java, now, is rather speedy, although, I still wouldn't recommend using the Java applets in their current state. Java, in my opinion, is more for the server side platform than for client side code, although there are several really nice Java applications such as Azureus.
As for the code, at most you may get an IndexOutOfBoundsException; and unless you rolled your own application server (I'm assuming this code is in a Java Servlet), the most that you would get is a 500 error with a stack trace; not a server crash and Denial Of Service.
This is also just extremely bad code. If they wanted to find out the request "method", the would could use several ways:
// if you only have access to the HttpServletRequest object if ("GET".equals(request.getMethod())) { } else if ("HEAD".equals(request.getMethod()) { }
If you're inside your own servlet, just implement the doGet() and doHead() methods that the abstract HttpServlet superclass provides.
As a side note, at least this this movie shows code, unlike the movie "Hackers". "Hackers" shows a virus that looks like pacman eating the contents on the screen.
Another favorite is Jurassic park, when the girl was trying to turn the power grid back on and exclaimed "This is a Unix system ... I know this!" even though it looked like a 3D flight simulator.
Java isn't slow
First of all... Java is not slow. There's a bad misconception in the world that Java is slow because of the previous experiences with Java Applets and prior versions of the JRE. Java, now, is rather speedy, although, I still wouldn't recommend using the Java applets in their current state. Java, in my opinion, is more for the server side platform than for client side code, although there are several really nice Java applications such as Azureus.
As for the code, at most you may get an IndexOutOfBoundsException; and unless you rolled your own application server (I'm assuming this code is in a Java Servlet), the most that you would get is a 500 error with a stack trace; not a server crash and Denial Of Service.
This is also just extremely bad code. If they wanted to find out the request "method", the would could use several ways:
// if you only have access to the HttpServletRequest objectif ("GET".equals(request.getMethod())) {
} else if ("HEAD".equals(request.getMethod()) {
}
If you're inside your own servlet, just implement the doGet() and doHead() methods that the abstract HttpServlet superclass provides.
As a side note, at least this this movie shows code, unlike the movie "Hackers". "Hackers" shows a virus that looks like pacman eating the contents on the screen.
Another favorite is Jurassic park, when the girl was trying to turn the power grid back on and exclaimed "This is a Unix system ... I know this!" even though it looked like a 3D flight simulator.