When your software, programming language, or other technology is just so fucking stupid.

[java] You want to create an object in one line?!?!??!

try {
  Class clazz = type.getClassIWant();
  Constructor c = clazz.getConstructor(Integer.TYPE,SomeOther.class,Integer.TYPE,Date.class);
  return (Benchmark)c.newInstance(samples,dao,days,from);
}
catch (NoSuchMethodException e) {
  throw new ServletException(e);
}
catch (InstantiationException e) {
  throw new ServletException(e);
}
catch (IllegalAccessException e) {
  throw new ServletException(e);
}
catch (InvocationTargetException e) {
  throw new ServletException(e);
}
  • Why aren’t constructors part of interfaces?
  • Why are there so many stupid exceptions I have to catch?
  • Why is this any “safer” than SomeClass.new(samples,dao,days,from)? The net effect is the same, but I’ve just added a pile of steaming shit to my codebase for no benefit?
  • Don’t even tell me to replace this with some Spring XML bullshit.  Angle brackets are like crack with none of the benefits (which I guess makes them cigarettes?)