Home » Java » Core Java

Core Java

Java 8 filter & map & collect & Stream Example

Hello guys, many of my readers emailed me to write a post about map and filter function of Java 8 because they found it difficult to understand and use. Even though I have previously blogged about both map() and filter(), I am writing this post again to explain the concept in more layman’s language for better understanding of my readers and fellow Java ...

Read More »

Predicate::not Coming to Java

Jim Laskey’s recent message “RFR: CSR – JDK-8203428 Predicate::not” on the OpenJDK core-libs-dev mailing list calls out JDK Bug JDK-8203428 [“Predicate::not”]. The “Summary” of JDK-8203428 states, “Introduce a new static method Predicate::not which will allow developers to negate predicate lambdas trivially.” It is currently assigned to JDK 11. The “Problem” section of JDK-8203428 provides a succinct description of the issue ...

Read More »

Why debugging in production is so tempting?

Debugging in Production Why debugging in production is so tempting? In one of my first jobs, one of the tasks I had was to fix a bug which used to occur from time to time in a very complex production system. That is easy! – I thought. I will reproduce the same situation in my development environment, find the broken ...

Read More »

Java Stream ORM Now with JOINs

Speedment is a Java Stream ORM Toolkit and Runtime that allows you to view database tables as standard Java Streams. Because you do not have to mix Java and SQL, the application becomes much more compact making it faster to develop, less prone to errors and easier to maintain. Streams are also strictly type-safe and lazily constructed so that only ...

Read More »

Templating with Rocker

In this post we will have a quick look at Rocker, a statically typed and fast Java 8 template engine. Requireded Dependencies To get started with Rocker we need to add the following dependencies to our project: <dependency>   <groupId>com.fizzed</groupId>   <artifactId>rocker-runtime</artifactId>   <version>0.24.0</version> </dependency> <!-- for hot-reloading support in development --> <dependency>   <groupId>com.fizzed</groupId>   <artifactId>rocker-compiler</artifactId>   <version>0.24.0</version> </dependency> We also need the Rocker Maven plugin, which converts Rocker templates to ...

Read More »

Java’s @Serial Annotation

The JDK may be getting another standard (predefined) annotation with JDK 11: @Serial. JDK-8202385 [“Annotation to mark serial-related fields and methods”] aims to add “some kind of ‘SerialRelated’ annotation to facilitate automated checking of the declarations of serial fields and methods.” The idea is to better indicate to a developer when a serialization-related field or method is misspelled similar to ...

Read More »

Updates on Records (Data Classes for Java)

There have been several updates related to “Java Data Classes” (AKA “Records”) in recent months. As I briefly mentioned in the post “Updates on JavaFX, Valhalla, Data Classes, and Java’s Floating-Point,” Brian Goetz‘s “Data Classes for Java” “explores possible directions for data classes in the Java Language.” Sadly, despite significant discussion on this potential new Java feature on the OpenJDK ...

Read More »