95% of all code makes me cry. The other 5% are white space.
// This will output 1.0 in Java Object o = true ? new Integer(1) : new Double(2.0); System.out.println(o); // To make things worse: Integer i = new Integer(1); if (i.equals(1)) i = null; Double d = new Double(2.0); Object o = true ? i : d; // NullPointerException! System.out.println(o);
Sometimes, it's the JLS itself that makes me cry the most.comments powered by Disqus
Send us your own example of code that made you cry! Please include:
Note that we may choose not to publish some submissions if we feel they're not appropriate. We hope you understand.
Use jOOQ, instead of JDBC.
jOOQ generates Java code from your database and lets you build typesafe SQL queries through its fluent API.