Welcome to the jOOQ Tuesdays series. In this series, we’ll publish an article on the third Tuesday every other month where we interview someone we find exciting in our industry from a jOOQ perspective. This includes people who work with SQL, Java, Open Source, and a variety of other related topics. I'm very excited to … Continue reading jOOQ Tuesdays: Thorben Janssen Shares his Hibernate Performance Secrets
Category: java
This category contains posts about things that are essentially Java-related
Cyclops-react Organises the Cambrian Explosion of Java 8 Libraries
We’re excited to announce another very interesting guest post on the jOOQ Blog by John Mcclean from AOL. AOL is a global digital media and technology company, founded in 1985 and once known as America Online, AOL is now part of the Verizon Group. AOL focuses on four areas - video, mobile, ad technology and … Continue reading Cyclops-react Organises the Cambrian Explosion of Java 8 Libraries
JSR-308 and the Checker Framework Add Even More Typesafety to jOOQ 3.9
Java 8 introduced JSR-308, which added new annotation capabilities to the Java language. Most importantly: Type annotations. It is now possible to design monsters like the below: https://twitter.com/lukaseder/status/711612663202238464 The code displayed in that tweet really compiles. Every type can be annotated now, in order to enhance the type system in any custom way. Why, you … Continue reading JSR-308 and the Checker Framework Add Even More Typesafety to jOOQ 3.9
The Parameterless Generic Method Antipattern
A very interesting question was posted to Stack Overflow and reddit just recently about Java generics. Consider the following method: <X extends CharSequence> X getCharSequence() { return (X) "hello"; } While the unsafe cast seems a bit wonky, and you might guess there's something wrong here, you can still go ahead and compile the following … Continue reading The Parameterless Generic Method Antipattern
Would We Still Criticise Checked Exceptions, If Java had a Better try-catch Syntax?
In the context of a previous blog post about JUnit 5, Maaartinus, one of our readers, has brought up a very interesting idea: The only problem with try-catch is its verbosity, which is something I can live with (IMHO a lone catch would do better, the implicit try would apply to all preceding code in … Continue reading Would We Still Criticise Checked Exceptions, If Java had a Better try-catch Syntax?
Watch Out For Recursion in Java 8’s [Primitive]Stream.iterate()
An interesting question by Tagir Valeev on Stack Overflow has recently caught my attention. To keep things short (read the question for details), while the following code works: public static Stream<Long> longs() { return Stream.iterate(1L, i -> 1L + longs().skip(i - 1L) .findFirst() .get()); } longs().limit(5).forEach(System.out::println); printing 1 2 3 4 5 The following, similar … Continue reading Watch Out For Recursion in Java 8’s [Primitive]Stream.iterate()
Java 10’s new Local-Variable Type Inference
News could hardly get more exciting than this, for a programming language aficionado! There is now a JEP 286 for Local-Variable Type Inference with status "Candidate". And a request for feedback by Brian Goetz, which I would love to invite you to participate in: http://mail.openjdk.java.net/pipermail/platform-jep-discuss/2016-March/000037.html Please do so, the survey remains open only from March … Continue reading Java 10’s new Local-Variable Type Inference
UI Developers! Choose Sensible Default Ordering!
Good decisions come from experience. Experience comes from making bad decisions. ― Mark Twain Today, let's look at one piece of experience and how we can turn that into good decisions when implementing UI logic. Please, all UI developers read this. The bad decision When UI developers display tabular data, it is very common for … Continue reading UI Developers! Choose Sensible Default Ordering!
How to Support Java 6, 8, 9 in a Single API
With jOOQ 3.7, we have finally added formal support for Java 8 features. This opened the door to a lot of nice improvements, such as: Creating result streams try (Stream<Record2<String, String>> stream = DSL.using(configuration) .select(FIRST_NAME, LAST_NAME) .from(PERSON) .stream()) { List<String> people = stream.map(p -> p.value1() + " " + p.value2()) .collect(Collectors.toList()); } Calling statements asynchronously … Continue reading How to Support Java 6, 8, 9 in a Single API
The Mute Design Pattern
Have you been writing a lot of code following the Mute-Design-Pattern™ lately? E.g. try { complex(); logic(); here(); } catch (Exception ignore) { // Will never happen hehe System.exit(-1); } There's an easier way with Java 8! Just add this very useful tool to your Utilities or Helper class: public class Helper { // 18395 … Continue reading The Mute Design Pattern
