I spent quite some time getting Selenium working on my development container. At the end, the solution was quite simple and I thought it would be a good idea to share it. I have tried to get this running by installing all the required software on my development container directly, but nothing really seemed to… Continue reading Running Selenium on a Docker Development Container
Category: Java
Records in Java (JEP 359, preview)
Records in Java look very promising to me and a great addition to the language. The ceremony of creating pure data holder classes will be well know to any Java developer. Sometimes we just create a class to transport some data from A to B. Most of the times we don’t even care about object… Continue reading Records in Java (JEP 359, preview)
Switch Expressions in Java (JEP 361)
With Java 14 we will get a new feature that simplifies the switch statement. It will provide a new and clearer way to write switch statements and in addition allows us to use switch as an expression yielding a value. New Syntax Forget about break! No fall through anymore – simple and concise. Today you… Continue reading Switch Expressions in Java (JEP 361)
Pattern Matching for instanceof (JEP 305)
Finally with Java 14 we get a (preview) feature I had on my wishlist for a long time. It eliminates the need to first test an object via instanceof operator and then (and I asusme it is the 90% case) cast it to exact that class in order to do something with it. Here is… Continue reading Pattern Matching for instanceof (JEP 305)
Launch Java Programs Without Compilation (JEP 330)
Since Java 11 we can run Java programs directly from the command line without the need to manually compile them first. Frankly speaking I don’t know if this is a feature I will ever use in my daily work as a developer. But it could be useful to learn Java and provides an easy way… Continue reading Launch Java Programs Without Compilation (JEP 330)
Java Collections Static Factory Methods
With Java9 we finally get an easy way to construct collections. I think the map is one that I will be using quite often. Now I can write: Map<String,String> lookupMap = Map.ofEntries( entry(“a”, “A”), entry(“b”, “B”), entry(“c”, “C”)); Instead of: Map<String, String> lookupMap = new HashMap<>(); lookupMap.put(“a”,”A”); lookupMap.put(“b”,”B”); lookupMap.put(“c”,”C”);
Java 8 default methods
Why OK, so interfaces can now provide a default implementation. This makes sense if you want to be able to add new methods to your interface without breaking existing implementations. Oracle uses default methods quiet extensively (see java.util.Collection). Simple example public class SimpleExample { interface Interface1 { default void test() { System.out.println(“– default test”); } default void test2() { System.out.println(“–… Continue reading Java 8 default methods
Spring Boot Health Checks
Spring Boot brings along some cool “production ready” features. Among them are the health checks. They are a great way to give you a quick overview about the system state. Is the database up and running, is my disk running out of space? Getting started Having a Spring Boot application already setup you just have… Continue reading Spring Boot Health Checks
I just solved a Java Performance Puzzle by @javaplumbr
I just solved a Java Performance Puzzle by @javaplumbr. Are you up for a challenge? https://plumbr.eu/blog/java-puzzle It was pretty fun, thank you guys!