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?)
6 months ago
import java.util.*;
public class Test {
public static void main(String args[]) {
Map map = new HashMap();
map.put(45L,"die now");
System.err.println(map.get(45));
}
}
Not only does this motherfucker compile with no warnings or other problems, but at runtime, it prints FUCKING NULL.
So, my question to the braintrust that designed an implemented the pile-of-shit-Generics is:
- If the literal “45” isn’t a long (and therefore is not a key in my map), WHY THE FUCK DOES IT COMPILE?
6 months ago
preparedStatement.setDate(1,new java.sql.Date(someDate.getTime())
Would would
ever want to create a
java.sql.Date from a
java.util.Date?!?!? And god FUCKING FORBID that
java.sql.PreparedStatement take a
java.util.Date…
6 months ago
Why is this:
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Calendar;
import org.apache.commons.collections.Factory;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.map.LazyMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
supposed to be superior to this:
import java.util.*;
import org.apache.commons.collections.*;
import org.apache.commons.collections.map.*;
import org.apache.commons.logging.*;
import org.springframework.beans.factory.annotation.*
The compiler should be able to figure all this shit out anyway; why does it even need to be there at all?
7 months ago
The only thing worse than bad comments is no comments. The only thing worse than no comments is Eclipse’s bullshit “helper” comments:
/**
* @param name
* @param type
* @return
*/
public void doit(String name, String type)
This is worse than useless. I suggest the new Eclipse defaults for developers too lazy to even delete empty comments be like so:
/** performs a feat I could never normally do: lands me a woman
* @param name I put the "E" in UNIX
* @param type I put the "E" in UNIX
* @return the shattered remains of my virginity
*/
public void doit(String name, String type)
Even better if it puts the authors name in the comments.
7 months ago
> mvn clean install && echo 'It Worked!!!'
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
It Worked!!!
System.exit(-1): ever hear of it ‘ya douchelords?
7 months ago
Unexpected method call createRelative("sub/"):
createRelative("sub/"): expected: 1, actual: 1 (+1)
This is the epitome of programmer FAIL. While I appreciate the effort to show me the difference in actual vs. expected, the actual actual is not shown. How about:
Unexpected method call createRelative("sub/"):
createRelative("sub/"): expected: 1, actual: 2 (+1)
Since this, you know, reflects what actually happened using accepted practices in the English language of the word “actual”, a colon and the number “2”.
8 months ago
- Start your spring-based dependency-injected pattern-compliant buzzword-happy Java application
- See an obscure message at INFO level about a bean not being initialized
- Watch as your application dumps thousands of spring exceptions (at INFO level, ‘natch)
- Open up the 500 line XML Bean configuration file
- Cry
“Spring: removing predictability, understandability, and the ability to efficiently debug and trace your code since 1999”
8 months ago
Are you tired of getting the most up-to-date data from your wiki, ticketing system and source code monitor? Trac is the tool for you. You may have previously thought Trac was just the world’s ugliest and least functional wiki, but NO! It also has the least updated RSS feeds and the world’s most worthless commit messages. Trac doesn’t bother you with such details as “the diff”; just the username and the message. And only about 3 hours after the commit!
8 months ago